bbs.csdn.net 打开页面的时候,浏览器右下方会浮出一个广告宣传框。 点击关闭后就关掉 请问是怎么做的? 谢谢了。。

解决方案 »

  1.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
     <HEAD>
      <TITLE> New Document </TITLE>
     </HEAD> <BODY>
    <input type="button" value="pop" onclick="floatDiv.show('test')"/>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
    <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
    <div id="test" style="width:300px;height:200px;display:none;position:absolute;background:#c0c0c0;">sdfasdfasdfasdf<input onclick="floatDiv.hide()" type="button" value="hide"/></div>
     </BODY>
    </HTML>
    <SCRIPT LANGUAGE="JavaScript">
    var floatDiv = function(){
    var d = document,dd = d.documentElement,db = d.body,fd,sd,sdh, timer,timer2,time,step,mr = Math.round,isStrict = d.compatMode == "CSS1Compat";
    return {
    show:function(id){
    time = 10;
    if(!fd){
    fd = d.body.appendChild(d.createElement('div'));
    sd = d.getElementById(id);
    fd.appendChild(sd);
    sd.style.cssText += ';display:block;position:absolute;left:0;';
    sdh = sd.offsetHeight;
    fd.style.cssText = "overflow:hidden;position:absolute;bottom:0;right:0;width:"+sd.offsetWidth+"px;height:"+sdh+"px;";
    }
    fd.style.display = 'block';
    sd.style.bottom = "-"+sdh+'px';
    step = sdh/55;
    timer = setInterval(function(){
    if(time<0){
    clearInterval(timer)
    }else{
    sd.style.bottom = parseInt(sd.style.bottom) + mr(time*step)+'px'
    time -=1;
    }
    },10)
    function scroll(){
    var st = isStrict?dd.scrollTop:db.scrollTop,c,dbh = isStrict?dd.clientHeight:db.clientHeight,t = 500;
    c = st  - fd.offsetTop + (dbh-sdh);
    c!=0&&(fd.style.top = fd.offsetTop + Math.ceil(c/10) + 'px',t=10);
    timer2 = setTimeout(scroll,t)
    };
    scroll();
    },
    hide:function(){
    time = 10;
    clearTimeout(timer2);
    timer = setInterval(function(){
    if(time<0){
    clearInterval(timer);
    fd.style.display = 'none';
    }else{
    sd.style.bottom = parseInt(sd.style.bottom) - mr(time*step)+'px'
    time -=1;
    }
    },10)
    }
    }
    }()
    </SCRIPT>
      

  2.   

    http://blog.csdn.net/wpabbs/archive/2008/05/21/2466297.aspx