Skip to content Skip to sidebar Skip to footer

Jquery Window.resize Not Working Just Reloading

I have a function to adjust the page so that it does not scroll regardless of the device, it works at all, however, when you rotate the screen or when you change the device to insp

Solution 1:

It is a syntax error document ready function closing bracket missing. Please refer below code.

$(document).ready(function() {
    changesize();
    $(window).resize(function() {
        changesize();
    });
});    

Solution 2:

I think this piece of code should fix your problem. It should trigger the resize function as needed when you flip your device. Let me know if it works :

window.addEventListener("orientationchange", function() {
    window.dispatchEvent(newEvent("resize"));
}, false);

Post a Comment for "Jquery Window.resize Not Working Just Reloading"