I'm using this script to hide the div with the id #main-slider.
But every time I load my page I can see the div for like 1 or 2 seconds and then it disappears, is there any way to make it take effect sooner?
Thank you.
window.onload = function() {
    if($(window).width() > 991) 
    {
        $('#main-slider').removeClass('hidden');
    }
    else
    {
        $('#main-slider').addClass('hidden');
    }
}
 
     
     
     
     
    