简体   繁体   中英

How to call window resize event jquery before page load mangento 2

I want to call this function before page load rendring but its only fire after page load can somebody help me.

$(window).on('load resize', function(){
    var win = $(this); //this = window

    if (win.width() <= 767)
    { 
        $('.logo').insertAfter('.panel.wrapper');
    }     
    else
    {
        $('.logo').insertAfter('.action.nav-toggle');
    }
});

How to call window resize event jquery before page load

您可以使用jQuery触发任何事件:

$(window).trigger('resize');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM