[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 ...
随机推荐
- opencv基于混合高斯模型的图像分割
#include "stdafx.h" #include <opencv\cv.h> #include <opencv\highgui.h> #includ ...
- 写 test-case心得
最近,写ticket较多,由于每天有忙不完的工作加不完的班,心里逐渐有一个小人儿在抱怨了.此种情况下,慢慢的写case时边变得懒散,想钻空闲,于是便简简单单总结几个纲要便完事.提交test-case到 ...
- python:让源码更安全之将py编译成so
应用场景 Python是一种面向对象的解释型计算机程序设计语言,具有丰富和强大的库,使用其开发产品快速高效. python的解释特性是将py编译为独有的二进制编码pyc文件,然后对pyc中的指令进行解 ...
- 2016-11-02: boost::enable_shared_from_this
使用场景 当类对象被shared_ptr管理时,需要在类自己定义的函数中把当前对象作为参数传递给其他函数时,必须传递一个shared_ptr,否则就不能保持shared_ptr管理这个类对象的语义.因 ...
- cs11_c++_lab4a
SparseVector.hh class SparseVector { private: //结构体不一定会用到,不用初始化 struct node { int index; int value; ...
- phthon
没什么特别的,我们项目的跨平台代码都是在Windows环境下编码,然后跨平台编译调试,C++和Python代码都是如此.我们用C++实现底层和框架,用ctypes将纯C的API给Python化,然后用 ...
- 1219 spring3 项目总结
Spring3 项目总结 列志华 (组长) http://www.cnblogs.com/liezhihua/ 团队guihub https://github.com/LWHTF/OrderingFo ...
- android 存储目录
之前一直不知道 sdcard/Android目录什么作用,我做的项目里面缓存数据到本地一般都是在sdcard上面建一个文件,然后把数据放在这个文件夹下面的子文件夹下.下面介绍一种更好的解决方法. 应用 ...
- Linux内核分析——汇编代码执行及堆栈变化
张潇月<Linux内核分析>MOOC课程http://mooc.study.163.com/course/USTC-1000029000 一.实验步骤 首先借助实验楼这个平台进入Linux ...
- 格式化namenode,造成无法启动datanode
一个常见的问题:格式化namenode,造成无法启动datanode的问题. 问题描述: 无法启动datanode,查看日志,datanote尝试n次启动无效后,会出现这个语句 INFO ...