窗口大小调整后处理事件jQuery插件ResizeEnd

 需要引入的文件:

    
    

代码调用:

    $(function(){
        $(window).on('resize', function() {
            $('.txt h3').text('调整中');
        });
     
        $(window).resizeEnd({
            delay : 500
        }, function(){
            var $body = $('body');
            var $ww = $(window).width();
            if($ww > 1500){
                $body.removeClass();
            } else if($ww < 1500 && $ww > 1000){
                $body.attr('class', 'window-width-1000-to-1500');
            } else if($ww < 1000){
                $body.attr('class', 'window-width-lt1000');
            }
            $('.txt h3').text('调整完成');
        });
        $(window).resizeEnd();
    });

 参考网址:http://www.dowebok.com/demo/119/

转载于:https://www.cnblogs.com/ilovexiaoming/p/4600260.html

你可能感兴趣的:(窗口大小调整后处理事件jQuery插件ResizeEnd)