• document.documentElement.scrollTop Google Chrome 不 兼容


       SetScroll();       

      function SetScroll() {

                if (window.attachEvent) {         

            window.attachEvent("onscroll", SaveScrollValue);     

            }           

      else {      

               window.addEventListener("scroll", SaveScrollValue, false);       

             }        

    }         

    Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(SetScrollValue);     

         function SaveScrollValue(sender, args) {

                var scrollTemp = document.getElementById("<%=HiddenFieldScroll.ClientID%>");     

            if (scrollTemp != null)            

         scrollTemp.value = document.body.scrollTop + document.documentElement.scrollTop;     

        }

            function SetScrollValue(sender, args) {        

                var scrollTemp = document.getElementById("<%=HiddenFieldScroll.ClientID%>");       

          if (scrollTemp != null)             {       

              //window.scroll(0, scrollTemp.value);     

                document.documentElement.scrollTop = scrollTemp.value;        

             if (document.documentElement.scrollTop == 0) {        

                 document.body.scrollTop = scrollTemp.value;    

                 }                     

           }  

           }

  • 相关阅读:
    wordpress 常用 数据库脚本
    Centos6.3安装locate
    WordPress路径相关函数总结
    关于电子杂志翻页的资源
    CentOS下MongoDB的升级
    WordPress数据库研究
    HOWTO:如何通过ServiceAddService修改已经存在的服务启动参数
    FAQ:Component的属性是否可以运行时修改?
    INFO:AdminStudio Debug
    HOWTO:如何修改InstallShield的运行环境
  • 原文地址:https://www.cnblogs.com/yangfeizbj/p/2831436.html
Copyright © 2020-2023  润新知