resize event

by fido3993

HTML

<p>
Window resized<span> 0 </span>times.</p>
<button>
Trigger resize event for the window
</button>

JavaScript

x=0;
$(document).ready(function(){
	$(window).resize(function(){
  	$("span").text( x+= 1);
  })
  $("button").click(function(){
  $(window).resize();
  })
})