对联带关闭的广告

<script language="JavaScript" >
 
 
var clove_body,clover_div,clover_left,clover_right,clover_temp,clover_all,clover_top
clover_all=document.body.clientWidth    //屏幕宽度
clove_body=1000    //网页宽度
clover_div=143    //对联宽度
clover_top=200    //对联上边距
clover_temp=(clover_all-clove_body)/2
clover_left=clover_temp-clover_div-8   //左对联靠左边距
clover_right=clove_body+clover_temp+13 //右对联靠左边距
if (clover_all>1023)//判断是否显示对联
{
theFloaters('followDiv1',clover_left,clover_top,'<a href=" http://www.XXXXXcom/" target=_blank><img src="../images/nianhui.gif"  style="border:1px solid #000;" width=143 height=195></a>');
theFloaters('followDiv2',clover_right,clover_top,'<a href=" http://www.XXXXX.com/" target=_blank><img src="../images/nianhui.gif"  style="border:1px solid #000;" width=143 height=195></a>');
scrollImg() ;
}
//获取当前滚动条位置
function scrollImg(){
    var posX,posY;
    if (window.innerHeight) {
        posX = window.pageXOffset;
        posY = window.pageYOffset;
    }
    else if (document.documentElement && document.documentElement.scrollTop) {
        posX = document.documentElement.scrollLeft;
        posY = document.documentElement.scrollTop;
    }
    else if (document.body) {
        posX = document.body.scrollLeft;
        posY = document.body.scrollTop;
    }
    followDiv1.style.top=(posY+clover_top)+"px";  //图片在IE中的位置
 followDiv2.style.top=(posY+clover_top)+"px";  //图片在IE中的位置
if (document.body.clientWidth<1023){followDiv1.style.display='none';followDiv2.style.display='none'}
 if (document.body.clientWidth>1023){followDiv1.style.display='block';followDiv2.style.display='block'}

    setTimeout("scrollImg()",100);
}
//生成对联
function theFloaters(id,x,y,content)
{
     document.write('<DIV align=center id='+id+' style="Z-INDEX: 10; POSITION: absolute;  width:100px; height:1px;left:'+x+'px;top:'+y+'px;font-size:12px; ">'+content+'<br><br>- <a href="javascript:;" onclick='+id+'.style.visibility=\'hidden\'>关闭</a> -</DIV>');
}
</SCRIPT>

你可能感兴趣的:(职场,广告,休闲,联带关闭)