• ios有些机型input和fixed导致的页面错位问题


    _fixIosInputH () {
      let [timeout, beforeTop] = [null, 0]
      $('input, textarea').on('focus', () => {
        // 记录当前页面的滚动高度
        beforeTop = document.body.scrollTop
        // 清除定时器
        clearTimeout(timeout)
      }).on('blur', () => {
        // 设置定时器 避免多个input时 第一个input失去焦点之后用户马上点击第二个input导致页面错位
        timeout = setTimeout(() => {
          // 恢复滚动高度
          document.body.scrollTop = beforeTop
        }, 100)
      })
    }
    
  • 相关阅读:
    111
    实验 12 综合练习二
    实验 11结构体
    作业 5 指针应用1
    实验 10 指针2
    实验9 指针1
    实验8 数组2
    实验7
    321
    实验9-2
  • 原文地址:https://www.cnblogs.com/Juliana1992/p/10332939.html
Copyright © 2020-2023  润新知