[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 ...
随机推荐
- adb server无法终止问题
这两天通过python去连接Android手机时,一直提示:Adb connection Error:An existing connection was forcibly closed by the ...
- oracle数据库中的基本语句
下面的都是最基本的oracle数据库的数据查询语句,这是我在网上整理的一份文档,方便以后自己的查看,当然,能把这些记下来就是最好的. 说明:查询表中的数据 1. select * from emp; ...
- Android test---JUnit
JUnit 单元测试 Android的单元测试基础也是比较简单,同样还是测试相加方法是否正确,测试用例还是用1+1?=2来个简单的Android单元测试: 1..打开eclipse,新建一个proje ...
- linux系统的常用命令
linux系统中常用的命令如下(以后经常补充): cd .. 返回上一级 cd use 进入use目录
- springmvc+mybatis整合
maven 依赖 <!-- springmvc --> <dependency> <groupId>org.springframework</groupId& ...
- Welcome to China
subway, railway, highway ,way way to dieofficer,announcer, professor, sir sir to lieWelcome to China
- arcgis对谷歌遥感影像拼接
对于遥感影像的研究多种多样,有小尺度的也有大尺度的还有多尺度的.可以研究一个城市里的一个区,也可以研究一个省甚至全国范围.当研究的区域比较大的时候,在一幅影像上无法包括研究区的所有范围,那么就需要下载 ...
- 接口与继承ppt作业
问:为什么子类的构造方法在运行之前,必须调用父类的构造方法?能不能反过来?为什么不能反过来? 答:子类拥有父的成员变量和成员方法,如果不调用,则从父类继承而来的成员变量和成员方法得不到正确的初始化.不 ...
- webform--LinQ的相关操作
LinQ:LineQ to Sq类:集成化的数据访问类:与ado.net没区别:--------------------------------------------LinQ的创建:右键,添加新建项 ...
- modelsim(3) - tips(zt)
1)如果需要跟踪信号,可以使用dataflow,直观,缺点是后仿太慢! http://www.cnblogs.com/asus119/archive/2011/04/01/2002525.html M ...