2009年5月21日
摘要: //文档状态改变 <iframe src="a.html" id="f" name="f" scrolling="no" frameborder=0 marginwidth=0 marginheight=0></iframe> <script> var doc=window.frames["f"].document; function s(){ if (doc.... 阅读全文
posted @ 2009-05-21 17:04 李辉明 阅读(243) 评论(1) 推荐(0) 编辑
摘要: //浏览器验证 function checkBrowser() { this.ver=navigator.appVersion this.dom=document.getElementById?1:0 this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0; this.ie5=(this.ver.indexOf("MS... 阅读全文
posted @ 2009-05-21 17:03 李辉明 阅读(197) 评论(0) 推荐(0) 编辑
摘要: //取得控件得绝对位置(1) <script language="javascript">function getoffset(e) {var t=e.offsetTop;var l=e.offsetLeft;while(e=e.offsetParent) {t+=e.offsetTop;l+=e.offsetLeft;}var rec = new Array(1); rec[0]= ... 阅读全文
posted @ 2009-05-21 17:03 李辉明 阅读(205) 评论(0) 推荐(0) 编辑
摘要: //各种尺寸 s+="\r\n网页可见区域宽:"+document.body.clientWidth; s+="\r\n网页可见区域高:"+document.body.clientHeight; s+="\r\n网页可见区域高:"+document.body.offsetWeight+"(包括边线的宽)"; s+="\r\n网页可见区域高:"+document.body.offsetHeight+... 阅读全文
posted @ 2009-05-21 17:01 李辉明 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 页面跳转:  window.location.href('地址')  window.open('地址', '_self')打开新窗口:  window.open('地址', '_blank')  只显示地址栏:window.open('地址', 'title', 'location=1, height=200, width=500')  只显示状态栏:window.open('地址', 'titl... 阅读全文
posted @ 2009-05-21 17:01 李辉明 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 事件源对象 event.srcElement.tagName event.srcElement.type 捕获释放 event.srcElement.setCapture(); event.srcElement.releaseCapture(); 事件按键 event.keyCode event.shiftKey event.altKey event.ctrlKey 事件返回值 event.ret... 阅读全文
posted @ 2009-05-21 16:59 李辉明 阅读(183) 评论(0) 推荐(0) 编辑