среда, 21 ноября 2012 г.

$(window).resize() issue in IE 9

if ($.browser.msie) {
    function debouncer(func, timeout) {
        var timeoutID, timeout = timeout || 200;
        return function () {
            var scope = this,
                args = arguments;
            clearTimeout(timeoutID);
            timeoutID = setTimeout(function () {
                func.apply(scope, Array.prototype.slice.call(args));
            }, timeout);
        }
    }
    $(window).resize(debouncer(function (e) {
        myfn(); //your staff here
    }));
} 
 
got it from here 

Комментариев нет: