[HTML 5] Detect visualViewport change

On mobile device, when you open / close the keyboard, zoom in / out, it might affect the visual viewport view (the actual page content); to detect changes we can reply on:

     window.visualViewport.addEventListener("resize", () => {
        // change happens
      });

 

posted @ 2023-05-24 17:53  Zhentiw  阅读(14)  评论(0编辑  收藏  举报