左右滚动广告

javascript

2008-06-10 10:45

<div id="win0" style="position:absolute; Right:10px; top:10px; width:136px; height:227px; z-index:25">
广告<img src="111.jpg" onClick="f(0);"><br>
</div>
<div id="win1" style="position:absolute; left:10px; bottom:20px;   width:136px; height:227px; z-index:25">广告<img src="111.jpg" onClick="f(1);"><br>
关闭</a></div>
<script language="javascript">

function f(x){
if (x==1)
document.getElementById("win1").style.display='none';

if (x==0)
document.getElementById("win0").style.display='none';
}

IE4 = document.all?1:0;
if (IE4){
setInterval('keepIE("win0",10,10)',1);
setInterval('keepIE("win1",10,10)',1);}

function keepIE(theName,theWantTop,theWantRight){
theRealTop=parseInt(document.body.scrollTop);
theTrueTop=theWantTop+theRealTop;
document.all[theName].style.top=theTrueTop;
theRealRight=parseInt(document.body.scrollRight);
theTrueRight=theWantRight+theRealRight;
document.all[theName].style.Right=theTrueRight;
}
</script>