![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
收藏代码
qq807700656
这个作者很懒,什么都没留下…
展开
-
获取元素相对于浏览器内容区左上角距离函数
function getOffset(obj){ function getLeft(o){ if(o==null){ return 0; }else{ return o.offsetLeft+getLeft(o.offsetParent)+(o.offsetParent?o.offsetParent.clientLeft:0); } } functio转载 2010-01-27 22:24:00 · 522 阅读 · 0 评论 -
window.open 浅谈
window.open 可以打开一个窗口。简单的打开一个页面为: window.open(abc.html);如果要限制打开的页面的大小等可以加参数:window.open(url,windowName,args);如:window.open(abc.html,myWin,height=100, width=400, toolbar= no, menubar=no, scrollba转载 2010-01-27 22:31:00 · 447 阅读 · 0 评论 -
静态页面中用js获取url中的参数
function GetQueryString(name) { var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if转载 2010-01-27 22:47:00 · 331 阅读 · 0 评论 -
关于layerX,layerY
当需要取到鼠标点击相对于层的位置信息时,在ie下可以用event.offsetX, evnet.offsetY,在Firefox下是event.layerX, event.layerY。但是firefox下总是有问题,取到的不是相对于层的坐标,而是pageX,pageY。 Google了半天也没有发现什么解决办法,最后在一个网站看到一个例子,原来在层中要设置position为absolute或者r转载 2010-01-27 22:41:00 · 1242 阅读 · 0 评论 -
position absolute,relative 定位
<!-- #container{ width:600px; height:500px; border:1px solid green; float:left; position:relative; } .item{ width:100px; height:80px; border:1px solid blue原创 2010-01-27 22:43:00 · 439 阅读 · 0 评论 -
兼容IE、FF 的屏幕居中div提示信息框
/*** version:1.0 * pubDate:09-06-24* author: kangzye*/function Displayer(){ _this=this; this.oldBodyMargin=document.body.style.margin; this.oldBodyHeight=document.body.style.height; this.o原创 2010-01-27 22:49:00 · 628 阅读 · 0 评论