// 滚动条位置
var scrollPosition = {
    // 位置
    result: 0,
    // 监听位置
    rememberPosition: function () {
        var type = 'scroll'
        var handle = function () {
            var scrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop
            scrollPosition.result = scrollTop
        }
        if (window.addEventListener) {
            window.addEventListener(type, handle, false)
        }
        if (window.attachEvent) {
            window.attachEvent('on' + type, handle)
        }
    },
    // 设置位置
    setPostion: function () {
        window.scrollTo(document.body.scrollWidth, scrollPosition.result)
    }
}

  

相关文章:

  • 2021-12-10
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2021-08-31
猜你喜欢
  • 2022-12-23
  • 2021-11-17
  • 2021-10-19
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-03
相关资源
相似解决方案