• 解决ie6不支持position: fixed;导致无法滚动的办法


    <div id="im" style="top: 100px; position: fixed; left: 5px; border: 3px solid #0066CC; padding: 3px; text-align: center; background: #ffffff;132px;">   34344135465465  </div>

     -------------------------解决ie6不支持position: fixed;导致无法滚动的办法---------------------------------------  

     if (navigator.userAgent.indexOf("MSIE 6.0") > 0){  

    //鼠标滚动事件  var scrollFunc=function(e){//获取函数代码

         e=e || window.event;//判断浏览器兼容哪个方法  

        if(e.wheelDelta){//IE/Opera/Chrome    

       //   alert("监听成功!");   

      // alert(document.documentElement.scrollTop);     

    }      else if(e.detail){//Firefox     

       //  alert("监听成功!");        

    // alert(document.documentElement.scrollTop);    

      }

     //解决浏览器问题
         var count=document.documentElement.scrollTop+document.body.scrollTop;
         var newheight=parseInt(count)+parseInt(110);
        $("#im").attr("style","background-image:url('image/big_bg.png'); border:none; position:fixed; _position:absolute; z-index:99; margin-left:800px;   padding: 3px; text-align: center; 200px;height: 150px;top:"+newheight+"px;");
     };
     /* /*注册事件*/
      if(document.addEventListener){
       //mousewheel OR DOMMouseScroll
     document.addEventListener('DOMMouseScroll',scrollFunc,false);//W3C
     // document.addEventListener('mousewheel',scrollFunc,false);//360
      }
     else{
     document.onmousewheel=scrollFunc; //IE/Opera/Chrome */
     }
     }

  • 相关阅读:
    前端工程师如何打发闲余时光?(转)
    比较好的前端开发工具
    蓝桥历年套题 约数倍数选卡片 博弈
    单调栈求全1(或全0)子矩阵的个数 洛谷P5300与或和 P3400仓鼠窝
    5-15
    2018CCPC桂林站G Greatest Common Divisor
    STL中的BITSET运用
    2018CCPC桂林站JStone Game
    牛客2019湘潭大学程序竞赛
    Combine String HDU
  • 原文地址:https://www.cnblogs.com/qgc88/p/3196663.html
Copyright © 2020-2023  润新知