微信6.7.4 ios12软键盘顶起页面后隐藏不回弹解决方案

  作者:chrispy

temporaryRepair () {let currentPosition, timerlet speed = 1 // 页面滚动距离timer = setInterval(function () {currentPosition = document.documentElement.scrollTop || document.body.scrollTopcurrentPosition -= speedwindow.scrollTo(0, currentPosition)

temporaryRepair () {

let currentPosition, timer

let speed = 1 // 页面滚动距离

timer = setInterval(function () {

currentPosition = document.documentElement.scrollTop || document.body.scrollTop

currentPosition -= speed

window.scrollTo(0, currentPosition) // 页面向上滚动

currentPosition += speed // speed变量

window.scrollTo(0, currentPosition) // 页面向下滚动

clearInterval(timer)

}, 1)

}


有用  |  无用

猜你喜欢