首页 > 常识 > 互联网 > 网站制作 > 常见问题

网页右下角广告漂浮代码和消息提示代码

作者:  时间:2016-07-02
描述:网页右下角广告漂浮代码和右下角弹出类似QQ或MSN消息提示的代码。
网页右下角广告漂浮代码
 
将以下代码添加到需要显示的网页即可!

<SCRIPT language="javascript">
document.writeln(" <script type="text/javascript">");
document.writeln(" <!--");
document.writeln("document.writeln(" <div id="ShowAD" style="position:absolute; z-index: 100;"> ");");
document.writeln("document.writeln("    <div id="ImgLayer" style="position:absolute; z-index:1; left: 0px;"> ");");
document.writeln("document.writeln("      <img src="http://51500w.cn/images/wt.jpg" width="250" height="150" border="0" usemap="#ivrinMap">");");
document.writeln("document.writeln("<map name="ivrinMap"><area shape="rect" coords="150,0,250,0" href="#" onclick="CloseIVR();return false;" target="_self"><area shape="rect" coords="0,1,250,150" href="http://goodlotto.net" target="_blank"></map>");");
document.writeln("document.writeln("    </div>");");
document.writeln("document.writeln("</div>");");
document.writeln("");
document.writeln("var bodyfrm = ( document.compatMode.toLowerCase()=="css1compat" ) ? document.documentElement : document.body;");
document.writeln("var adst = document.getElementById("ShowAD").style;");
document.writeln("adst.top = ( bodyfrm.clientHeight - 140 ) + "px";");
document.writeln("adst.left = ( bodyfrm.clientWidth - 250 ) + "px";");
document.writeln("function moveR() {");
document.writeln("    adst.top = ( bodyfrm.scrollTop + bodyfrm.clientHeight - 150 ) + "px";");
document.writeln("    adst.left = ( bodyfrm.scrollLeft + bodyfrm.clientWidth - 250 ) + "px";");
document.writeln("}");
document.writeln("setInterval("moveR();", 80);");
document.writeln("function CloseIVR(){");
document.writeln("    adst.display='none';");
document.writeln("}");
document.writeln(" //-->");
document.writeln(" </script>");
document.writeln("");
</SCRIPT>
 
右下角弹出类似QQ或MSN消息提示代码
 
<SCRIPT language=JavaScript>  
<!--  
 
/**//*  
*    消息构造  
*/  
function CLASS_MSN_MESSAGE(id,width,height,caption,title,message,target,action){  
    this.id     = id;  
    this.title  = title;  
    this.caption= caption;  
    this.message= message;  
    this.target = target;  
    this.action = action;  
    this.width    = width?width:200;  
    this.height = height?height:120;  
    this.timeout= 150;  
    this.speed    = 20; 
    this.step    = 1; 
    this.right    = screen.width -1;  
    this.bottom = screen.height; 
    this.left    = this.right - this.width; 
    this.top    = this.bottom - this.height; 
    this.timer    = 0; 
    this.pause    = false;
    this.close    = false;
    this.autoHide    = true;
}  
  
/**//*  
*    隐藏消息方法  
*/  
CLASS_MSN_MESSAGE.prototype.hide = function(){  
    if(this.onunload()){ 
 
        var offset  = this.height>this.bottom-this.top?this.height:this.bottom-this.top; 
        var me  = this; 
 
        if(this.timer>0){   
            window.clearInterval(me.timer);  
        } 
 
        var fun = function(){  
            if(me.pause==false||me.close){
                var x  = me.left; 
                var y  = 0; 
                var width = me.width; 
                var height = 0; 
                if(me.offset>0){ 
                    height = me.offset; 
                } 
     
                y  = me.bottom - height; 
     
                if(y>=me.bottom){ 
                    window.clearInterval(me.timer);  
                    me.Pop.hide();  
                } else { 
                    me.offset = me.offset - me.step;  
                }

从手机浏览器访问《生活宝典》

站内搜索
无相关信息
微商帮
世界网站大全
中国科研团队:大象的长鼻子是如何越变越长了
中国科研团队:大象的长
自己是否能够像自己想的那样做成一件事,身旁人的判断会比自己准确
自己是否能够像自己想
火宫殿:吃喝玩乐看,烧香拜神佛,红火的庙会经济
火宫殿:吃喝玩乐看,烧香
眼见为实也不为实,更须谨慎看到的并非全貌
眼见为实也不为实,更须