您常来盼盼的家园,会有很多惊喜的!
一段文字无论您怎样拉动滚动条,它浮都在最上层不会消失,你是不是早就想要这样的特效了呢?赶紧试一试吧!
原代码如下:
在HTML中的<head>和</head>之间加入,其中的文字可改为您自己需要的内容。
<div id="KBStatic" style="position:absolute; left:0px; top:0px;
width:200px; height:100px; z-index:25">
您常来盼盼的家园,会有很多惊喜的!</div>
<script language=JavaScript>
function KB_keepItInIE(theName,theWantTop,theWantLeft) {
theRealTop=parseInt(document.body.scrollTop)
theTrueTop=theWantTop+theRealTop
document.all[theName].style.top=theTrueTop
theRealLeft=parseInt(document.body.scrollLeft)
theTrueLeft=theWantLeft+theRealLeft
document.all[theName].style.left=theTrueLeft
}
function KB_keepItInNN(theName,theWantX,theWantY) {
theRealLay=document.layers[theName]
theBadX=self.pageYOffset
theBadY=self.pageXOffset
theRealX=theBadX+theWantX
theRealY=theBadY+theWantY
theRealLay.moveTo(theRealY,theRealX)
}
IE4=(document.all)?1:0
NN4=(document.layers)?1:0
if (IE4)
setInterval('KB_keepItInIE("KBStatic",0,0)',1)
if (NN4)
setInterval('KB_keepItInNN("KBStatic",0,0)',1)
</script>