Resize on div element

前端 未结 11 1391
既然无缘
既然无缘 2020-11-28 08:31

jQuery has the resize() - event, but it just work with window.

jQuery(window).resize(function() { /* What ever */ });

This wor

11条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-28 08:55

    DIV does not fire a resize event, so you won't be able to do exactly what you've coded, but you could look into monitoring DOM properties.

    If you are actually working with something like resizables, and that is the only way for a div to change in size, then your resize plugin will probably be implementing a callback of its own.

提交回复
热议问题