zoukankan      html  css  js  c++  java
  • IE6与IE7下一点样式的区别

    function OpenSendNote(strMobileTel,strName,theThis)
    {
        document.all.txtMobileTel.value=strMobileTel;
        document.all.txtMsg_Content.value="请输入短信内容";
        document.all.txtReserve.value="";
        document.all.txtName.value=strName;
        document.all.tbSendNote.style.visibility="visible";
       
        var intY=theThis.offsetTop;
        var objTmp=theThis.offsetParent; 
        for(i=0;i<100;i++ )
        {
            intY=intY+(objTmp.offsetTop); 
            objTmp=objTmp.offsetParent;
            if(objTmp==window.document.body){break;}
            i++;       
        }
          document.getElementById("tbSendNote").style.top=intY;
        //var topY = intY +'px';
        //document.getElementById("tbSendNote").style.top=topY;
    }

    这是一断发送短信对话框的脚本,在IE7下这段脚本是没有问题的,但在IE6下会报错,让你调试,无法打开那个发送短信对话框,原因在倒数第三行。document.getElementById("tbSendNote").style.top=intY; 在IE7下默认是对intY加了‘PX’的,所以能正常运行。但为了兼容IE6,你需要把这行,改为下面注释的两行。即document.getElementById("tbSendNote").style.top=intY;换成var topY = intY +'px';
      document.getElementById("tbSendNote").style.top=topY;
  • 相关阅读:
    Python基础-博客
    已开发程序查询
    新语法
    html基础
    python操作excel
    Selenium
    练习2---(request,ajax爬取头条数据)
    练习1---request+正则(猫眼电影)
    框架---scrapy(基本用法)
    框架---Scrapy (框架安装)
  • 原文地址:https://www.cnblogs.com/vihone/p/1527292.html
Copyright © 2011-2022 走看看