I am facing a problem whenever I resize the browser window by (CTRL+SHFT+M) or change the orientation of window. counter_
variable value increament by 4 or 7 instead of 1.
HTML:
<div id="my_element">
<span id="text">0</span> window resize.
</div>
Script:
$(function () {
var counter_ = 0;
$(window).on('resize', function () {
$('#text').text(++counter_);
});
});
Output Should be:
0 window resize.
1 window resize.
2 window resize.
..
..