搜 索
您现在的位置: 凯世软件学院 >> 网页设计 >> 经验技巧 >> 文章正文
  最新热门
  业界新闻
  相关文章
    没有相关文章
  业界新闻
 
 

打开页面右下角跳出QQ的提示信息类似框的广告代码

作者:佚名    文章来源:本站原创    点击数:    更新时间:2007-1-31

打开网页后右下角跳出QQ的提示信息类似框,很多人都会去点击。

if (cbr("Opera")){
        var de = document.body;
} else if (cbr("Gecko")){
        if (document.doctype && document.doctype.indexOf("XHTML")>-1) {
                var de = document.documentElement;
        } else {
                var de = document.body;
        }
} else {
        var de = document.body;
}
function cbr (brs) {
        if (window.navigator.userAgent.indexOf(brs)>-1) {
                return true;
        }else{
                return false;
        }
}
window.onload = zoxadGetMsg;
window.onresize = zoxadResizeDiv;
window.onerror = function(){}
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
function zoxadGetMsg()
{
        try{
        divTop = parseInt(document.getElementById("zoxadPlayer").style.top,10)
        divLeft = parseInt(document.getElementById("zoxadPlayer").style.left,10)
        divHeight = parseInt(document.getElementById("zoxadPlayer").offsetHeight,10)
        divWidth = parseInt(document.getElementById("zoxadPlayer").offsetWidth,10)
        docWidth = de.clientWidth;
        docHeight = de.clientHeight;
        document.getElementById("zoxadPlayer").style.top = parseInt(de.scrollTop,10) + docHeight + 10;
        document.getElementById("zoxadPlayer").style.left = parseInt(de.scrollLeft,10) + docWidth - divWidth
        document.getElementById("zoxadPlayer").style.visibility="visible"
        objTimer = window.setInterval("zoxadMoveDiv()",10)
        }
        catch(e){}
}

function zoxadResizeDiv()
{
        i+=1
        try{
        divHeight = parseInt(document.getElementById("zoxadPlayer").offsetHeight,10)
        divWidth = parseInt(document.getElementById("zoxadPlayer").offsetWidth,10)
        docWidth = de.clientWidth;
        docHeight = de.clientHeight;
        document.getElementById("zoxadPlayer").style.top = docHeight - divHeight + parseInt(de.scrollTop,10)
        document.getElementById("zoxadPlayer").style.left = docWidth - divWidth + parseInt(de.scrollLeft,10)
        }
        catch(e){}
}

function zoxadMoveDiv()
{
        try
        {
        if(parseInt(document.getElementById("zoxadPlayer").style.top,10) <= (docHeight - divHeight + parseInt(de.scrollTop,10)))
        {
        window.clearInterval(objTimer)
        objTimer = window.setInterval("zoxadResizeDiv()",1)
        }
        divTop = parseInt(document.getElementById("zoxadPlayer").style.top,10)
        document.getElementById("zoxadPlayer").style.top = divTop - 2
        }
        catch(e){}
}
function closezoxadad()
{
        document.getElementById('zoxadPlayer').style.visibility='hidden';
        if(objTimer) window.clearInterval(objTimer)
}
//document.write(iframeResource);
document.write("<div id='zoxadPlayer' style='z-index:99999;left:0px;top:0px;height:160px;width:256px;visibility:hidden;position:absolute;'><iframe src='ad.html' frameborder='0' scrolling='no' width='256px' height='160px'></iframe></div>");
window.setInterval("closezoxadad()",15000);