How to detect DIV's dimension changed?

后端 未结 25 2643
抹茶落季
抹茶落季 2020-11-22 06:14

I\'ve the following sample html, there is a DIV which has 100% width. It contains some elements. While performing windows re-sizing, the inner elements may be re-positioned,

25条回答
  •  一整个雨季
    2020-11-22 06:52

    I found this library to work when MarcJ's solution didn't:

    https://github.com/sdecima/javascript-detect-element-resize

    It's very lightweight and detects even natural resizes via CSS or simply the HTML loading/rendering.

    Code sample (taken from the link):

    
    
    

提交回复
热议问题