JQuery: How to call RESIZE event only once it's FINISHED resizing?

后端 未结 8 1258
一向
一向 2020-11-22 07:29

How do I call a function once the browser windows has FINISHED resizing?

I\'m trying to do it like so, but am having problems. I\'m using the JQuery Resize

8条回答
  •  不要未来只要你来
    2020-11-22 08:10

    var lightbox_resize = false;
    $(window).resize(function() {
        console.log(true);
        if (lightbox_resize)
            clearTimeout(lightbox_resize);
        lightbox_resize = setTimeout(function() {
            console.log('resize');
        }, 500);
    });
    

提交回复
热议问题