How to automatically execute a Javascript function w开发者_如何学Pythonhenever width or height of a div changes? I don't want to trigger an event manually. I am using jQuery.
Try this plugin:
- http://benalman.com/projects/jquery-resize-plugin/
From their example:
$("#unicorns").resize(function(e){
// do something when #unicorns element resizes
});
Unfortunately there is no built in support for this. the .resize() function is only for the window object, and the .change() function is only for input elements. You will need to do it manually to the best of my knowledge.
加载中,请稍侯......
精彩评论