本页主题: [求助]js漂浮问题 打印 | 加为IE收藏 | 复制链接 | 收藏主题 | 上一主题 | 下一主题

waphk
级别: 入门弟子


精华: 0
发帖: 1
威望: 1 点
财富: 5 K币
贡献值: 0 点
注册时间:2008-04-01
最后登录:2008-04-01

 [求助]js漂浮问题

   
    window.onresize = baiduResizeDiv;
    window.onerror = function(){}
    var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0;
    String.prototype.Trim  = function(){return this.replace(/^\s+|\s+$/g,"");}
   
    function baidu_collapse(obj){
    ct = document.getElementById('tab_c_'+(1+3));
        if(ct.style.display=="none"){
            ct.style.display="";
            obj.src=obj.src.replace("b.gif","a.gif");
        } else {
            ct.style.display="none";
            obj.src=obj.src.replace("a.gif","b.gif");
        }
        baiduResizeDiv();
    }
   
    function baiduMsg()
    {
        try{
            divTop = parseInt(document.getElementById("eMeng").style.top,10);
            divLeft = parseInt(document.getElementById("eMeng").style.right,10);
            divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
            divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);
            docWidth = document.body.clientWidth;
            docHeight = document.body.clientHeight;
            document.getElementById("eMeng").style.top = parseInt(document.body.scrollTop,10) + docHeight + 10;// divHeight
            document.getElementById("eMeng").style.right = parseInt(document.body.scrollLeft,10) + docWidth - divWidth;
            document.getElementById("eMeng").style.visibility="visible";
            objTimer = window.setInterval("baidu_move_div()",10);
        }catch(e){}
    }
   
    function baiduResizeDiv()
    {
        i+=1;
        try{
            divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10);
            divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10);
            docWidth = document.body.clientWidth;
            docHeight = document.body.clientHeight;
            document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.body.scrollTop,10);
            document.getElementById("eMeng").style.right = docWidth - divWidth + parseInt(document.body.scrollLeft,10);
        }catch(e){}
    }
   
    function baidu_move_div()
    {
        try{
            if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.body.scrollTop,10)))
            {
                window.clearInterval(objTimer);objTimer = window.setInterval("baiduResizeDiv()",1);
            }
            divTop = parseInt(document.getElementById("eMeng").style.top,10);
            document.getElementById("eMeng").style.top = divTop - 1;
        }catch(e){}
    }
   
     function valid_message()
    {
        objMess = lea_mess.message;
        objContact = lea_mess.contact;
       
        objMess.value = objMess.value.Trim();
        objContact.value = objContact.value.Trim();
       
        strMess = objMess.value;
        strContact = objContact.value;


这段代码是左漂浮的,怎么改成右漂,知道的请帮忙,谢谢
顶端 Posted: 2008-04-01 18:31 | [楼 主]
帖子浏览记录 版块浏览记录
IECN社区 » JavaScript/Ajax

Time now is:01-09 03:23, Gzip disabled 京ICP备06069722号
Powered by PHPWind v6.3.2 Certificate Code © 2003-08 PHPWind.com Corporation