Resizing an element triggers the resize event of the window
问题 Looks like that when resizing an HTML element, the windows' resize event gets fired as well. Since I want to execute different logic when resizing elements and when the window gets resized, is there a non-hackish way of dealing with this? http://jsfiddle.net/CPUwW/1/ $(function(){ $(window).on('resize', function(){ // This event gets fired when the #my_element div gets resized, event if // window doesn't get resized itself $('#text').text(++resizes); }); $('#my_element').resizable(); }); In