Edit in JSFiddle

$(window).resize(function () {
    $('.log').prepend('<div>' + $(window).width() + '</div>');  // code on resize window

    /*
    var resizeTimer = null;
    if (resizeTimer) clearTimeout(resizeTimer);
    resizeTimer = setTimeout(function () {
        $('.log').prepend('<div>' + $(window).width() + '</div>');  // code on resize window
    }, 100); // adding 100 milliseconds interval for avoiding jumps
    */

});
<div class="log">Try to resize the window.</div>