jQuery resize not working at FireFox, Chrome and Safari

后端 未结 8 1299
刺人心
刺人心 2020-12-03 11:30
$(\"#dvMyDIV\").bind(\"resize\", function(){
    alert(\"Resized\");
});

or

$(\"#dvMyDIV\").resize(function(){
    alert(\"Resized\         


        
8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-03 12:03

    I might suggest something like this:

    1) on page load, get width of your div and put it in a global variable

    2) on execution of whatever operation directly or implicitly resizes that div (which I assume is a javascript-driven event) check the new width against the old width and update the global value with the new width.

提交回复
热议问题