[html]经验集
禁止默认的右键菜单:
window.document.oncontextmenu = function(){ return false;}
WebBrowser 控件用法:(手动填充内容)
// 首先导航到空白页面
if (webBrowser1.Document != null)
webBrowser1.Document.OpenNew(true);
else
webBrowser1.Navigate("about:blank");
webBrowser1.Document.Write("<style type='text/css'>.e{color:tomato}.r{color:limegreen}</style>");
webBrowser1.Document.Write("<span class='e'>来个红色文字!</span><hr />");
webBrowser1.Document.Write("<span class='r'>来个绿色文字!</span><br />");
常用 html 编辑器:http://www.dcloud.io/
一个空框架( IE6下会假死 )
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Demo</title>
<style type='text/css'>
body{margin:0;padding:0;overflow-x:auto}
</style>
<script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
<script>
window.onresize=function(){Resize()}
$(function(){Resize()})
function Resize(){
$('.main').height($(window).height()-$('#title').height())
$('.left').height($('.main').height()-$('.date').height())
}
</script>
</head>
<body>
<table id='title' style="width:100%;background:silver;">
<tr>
<td align="center">
<div style="width:1260px;height:30px;line-height:30px;text-indent:20px;text-align:left;">
标题
</div>
</td>
</tr>
</table>
<div class='main' style="width:1260px;margin:0 auto;">
<div class='left' style="width:190px;float:left;height:500px;border-right:1px dotted gray;border-left:1px dotted gray;">
<div class='date' style="background:gray;width:190px;height:60px;position:absolute;bottom:0"></div>
</div>
<div class='main' style="width:1060px;margin-left:200px;overflow:auto">
<div style="height:1000px;">一</div>
</div>
</div>
</body>
</html>
常用 javascript 格式化日期
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="js/jquery-1.12.4.min.js"></script>
<script type="text/javascript">
// 对Date的扩展,将 Date 转化为指定格式的String
// 参照 https://msdn.microsoft.com/zh-cn/library/8kb3ddd4.aspx
// 参照 http://blog.csdn.net/vbangle/article/details/5643091/
// 月(M)、日(d)、小时(H)、分(m)、秒(s)、季度(q) 可以用 1-2 个占位符,
// 年(y)可以用 1-4 个占位符,毫秒(f)只能用 1 个占位符(是 1-3 位的数字)
// 例子:
// (new Date()).Format("yyyy-MM-dd HH:mm:ss.f") ==> 2006-07-02 08:09:04.423
// (new Date()).Format("yyyy-M-d H:m:s.f w") ==> 2016-8-9 10:1:8.931 星期二
Date.prototype.Format = function(fmt)
{
var o = {
"M+" : this.getMonth()+1, //月份
"d+" : this.getDate(), //日
"H+" : this.getHours(), //小时
"m+" : this.getMinutes(), //分
"s+" : this.getSeconds(), //秒
"f" : this.getMilliseconds(), //毫秒
"w" : "星期"+"日一二三四五六"[this.getDay()],//星期
"q" : Math.floor((this.getMonth()+3)/3) //季度
};
if(/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
for(var k in o)
if(new RegExp("("+ k +")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
return fmt;
}
var time1 = new Date().Format("yyyy-MM-dd HH:mm:ss w");
var time2 = new Date().Format("yyyy-MM-dd");
$(function(){
$('#t1').text(time1);
$('#t2').text(time2);
});
</script>
</head>
<body>
<div id="t1"></div>
<div id="t2"></div>
</body>
</html>
Razor 里如果要判断当前是否是调试模式输出,可以读取这个属性
HttpContext.Current.IsDebuggingEnabled
一段弹窗代码 详情可参考:http://www.w3help.org/zh-cn/causes/BX1053
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Demo</title>
</head>
<body>
<input type="button" value="弹窗" onclick="showWindow()" /><br />
<input type="text" value="普通 Input" /><br />
<input type="text" value="只读 Input" readonly /><br />
<input type="text" value="只读 Input" style="border:0" readonly /><br />
<input type="text" value="禁用 Input" disabled />
<input type="text" value="禁用 Input" style="border:0;background:#fff" disabled />
<script type="text/javascript">
function showWindow(){
var win = window.open('',"",'height=200,width=400,top=200,left=200,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no, titlebar=no');
win.document.write('具体消息');
win.document.close();
}
</script>
</body>
</html>
更多资源可参考:http://www.miniui.com/demo
[html]经验集的更多相关文章
- [转]Oracle 经验集
-- 转换字符串为日期格式 to_date('2011-12-30 11:54:30','yyyy-MM-dd:hh24:mi:ss') Oracel 用 C# 连接,Microsoft 自带的 Sy ...
- [转]Windows 经验集
Windows Server 2012 R2 显示 这台电脑 图标方法: 来自:https://jingyan.baidu.com/article/f25ef2544f6883482c1b82e5.h ...
- [转][Dapper]SQL 经验集
condition.Append(" AND ChineseName like @name"); p.Add("@name", "%" + ...
- [java]经验集
Calendar c = Calendar.getInstance(); c.set(1999,12,21); SimpleDateFormat sdf = new SimpleDateFormat( ...
- [Java.web][eclipse]经验集
自动提示部分内容来自:http://www.cnblogs.com/mashuangying2016/p/6549991.html 使用 Eclipse 调试 Tomcat 的设置: Window - ...
- [转][c#]注册表经验集
在 win7 64位的系统中,为了将程序做成绿化版(单EXE文件),一些设置准备放到 regedit(注册表)中. 测试时发现网上的 demo 可以读,但写的值调试不报错,相应位置却不存在,困扰了许久 ...
- [转]加密经验集 => C#
下载地址 代码摘自 C#高级编程(第7版) 第579页 不对称加密
- [转]SQLite 经验集
SQLite 的默认时间 转自:http://www.cnblogs.com/pennant/archive/2011/08/11/2134897.html select strftime('%Y-% ...
- [转]MySQL 经验集
-- my.ini -> 在 [mysqld] 节点下加入一行 skip-grant-tables 然后重启服务 -- 接下来无密码登录到 mysql 执行以下命令 use mysql show ...
随机推荐
- PullToRefreshListView加载更多定位的解决方法
之前项目里,早起用到了PullToRefreshListView,后来一部分用到了RefreshListView,最近在做优化的时候,其中一个问题就是PullToRefreshlistView上拉加载 ...
- 移动端使用rem适配及相关问题
移动端适配方案,说多也很多.可以使用百分比布局,但百分比与em都是基于父元素进行计算的,在实际应用中不是很方便.使用rem不仅可以设置字体大小,块大小也可以设置.而且可以良好的适配各种终端,所以这方案 ...
- H5全屏滚动专题页最佳实践
1.slip.js + rem.js 主要插件: slip.js github: https://github.com/binnng/slip.js rem.js 插件为阿里淘宝的 rem 实现的基础 ...
- 头像上传,拖拽,裁切(HTML5)版本
演示地址: http://codeman35.itongyin.com:19002/v1/web_demo.html 功能: 支持滚轴放大缩小,鼠标拖动,裁切可视区域
- Shaders(读书笔记4 --- Real-Time rendering)
1. vertex,pixel以及geometry shaders共享一个programming model,即common-shader core,在GPU架构中的unified shader可以和 ...
- IAR调节字体大小
在主面板上点击tools->Options,然后点开Editor,选择下面的Colors and Fonts选项,最后选右上方的Font,选择要设置的字体就OK了.
- Linux第三周——跟踪分析内核的启动过程
跟踪分析内核的启动过程实验 张潇月<Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 这周主要学习的是对内核 ...
- 在SQLSERVER中快速有条件删除海量数据技巧推荐
解释: 如果你的硬盘空间小,并且不想设置数据库的日志为最小(因为希望其他正常的日志希望仍然记录),而且对速度要求比较高,并清除所有的数据建议你用turncate table1,因为truncate 是 ...
- Kafka安装
一.下载kafka: http://kafka.apache.org/downloads 二.解压 tar -zxvf kafka_2.10-0.10.0.1.tgz 三.kafka需要用到zooke ...
- ubuntu客户端使用RDP协议连接windows服务器
如果服务器是linux或unix,可以使用ssh远程连接服务器.也有服务器是windows的,通常使用RDP协议进行连接. 1 环境 客户端:ubuntu14.04 LST 服务器:windows ...