javascript和JQuery焦点图和代码特效大全
当前最流行的开源CMS网站系统大全
当前位置:首页 > 网站技术 > 常用代码

点击网页任何地方都会弹出广告的网页

来源:IT技术网编辑:雨天发布于:2017-01-22人围观

<Script language="javascript">
<!--
var Then = new Date();
Then.setTime(Then.getTime() + 24*60*60*1000 ); //秒分
var cookieString = new String(documents.cookie);
var cookieHeader = 'POPWIN' ;
var beginPosition = cookieString.indexOf(cookieHeader);
if (beginPosition == -1)
{
        var newtop=0
        var newleft=0
        if (navigator.appName == 'Netscape' ) {
                layerStyleRef="layer.";
                layerRef="document.layers";
                styleSwitch="";
                }
                else
                {
                layerStyleRef="layer.style.";
                layerRef="document.all";
                styleSwitch=".style";
                }
        var autoclick_ok=false;
        function toExit(){
                autoclick_ok=true;
                documents.cookie = "Cookie9=POPWIN;expires="+ Then.toGMTString() +";path=/";
    }
        function doMouseMove() {
                layerName = 'iit'
                eval('var curElement='+layerRef+'["'+layerName+'"]')
                eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.visibility="hidden"')
                
                if(!autoclick_ok)
                {
                        eval('curElement'+styleSwitch+'.visibility="visible"')
                }else{
                        eval('curElement'+styleSwitch+'.visibility="hidden"')
                }
                
                eval('newleft=document.body.clientWidth-curElement'+styleSwitch+'.pixelWidth')
                eval('newtop=document.body.clientHeight-curElement'+styleSwitch+'.pixelHeight')
                eval('height=curElement'+styleSwitch+'.height')
                eval('width=curElement'+styleSwitch+'.width')
                width=parseInt(width)

 height=parseInt(height)
                if (event.clientX > (document.body.clientWidth - 10 - width))
                {
                newleft=document.body.clientWidth + document.body.scrollLeft - 10 - width
                }
                else
                {
                newleft=document.body.scrollLeft + event.clientX-10
                }
                eval('curElement'+styleSwitch+'.pixelLeft=newleft')
                if (event.clientY > (document.body.clientHeight - 5 - height))
                {
                newtop=document.body.clientHeight + document.body.scrollTop - 5 - height
                }
                else
                {
                newtop=document.body.scrollTop + event.clientY-10
                }
                eval('curElement'+styleSwitch+'.pixelTop=newtop')
}
        document.onmousemove = doMouseMove;
        if (navigator.appName == "Netscape" ) {
        }
        else
        {
                document.write('<div ID=OuterDiv>')
                document.write('<a href=http://www.kxytv.com target="_blank"><img ID=iit src="zs.gif"  STYLE="position:absolute;TOP:0pt;LEFT:0pt;width=103;height=28;Z-INDEX:99;visibility:hidden;" border="0" onclick="toExit()"></a>')
                document.write('</div>')
        }
}
-->
</Script> 

注意把src="zs.gif"中的图片做出透明的没有内容的空白图片,把document.write('<a href=http://www.my398.com 中的地址换成你的广告内容页面就行。

与相关的文章
有时间的话来看看IT界的突发事件