H5 Input解决橡皮筋效果

//获取焦点
 cancelScroll(e) {
        clearTimeout(this.timeoutTimer)
        clearTimeout(this.timeoutTimer01)
        if (utils.isAndroid()) {
            this.timeoutTimer01 = setTimeout(() => {
                e.target.scrollIntoViewIfNeeded()
            }, 800)
        }
    },
    // 输入框blur失焦
    scrollTopFn() {
        clearTimeout(this.timeoutTimer)
        clearTimeout(this.timeoutTimer01)
        this.timeoutTimer = setTimeout(() => {
            window.scroll(0, 0)
        }, 300)
    },

猜你喜欢

转载自www.cnblogs.com/zhanghongb/p/12521924.html