- 博客(6)
- 收藏
- 关注
原创 兼容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
转载 静态页面中用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
原创 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 438
转载 关于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 1237
转载 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 446
转载 获取元素相对于浏览器内容区左上角距离函数
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
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人