Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Responsive menu: toggle adds inline styles Reply To: Responsive menu: toggle adds inline styles

#240121
Atelierbram
Participant

With the jQuery resize function, you can get what you want I think

$(window).resize(function(){
    var winwidth = $(window).innerWidth();
    if(winwidth < 768){
        $('.navigation').hide();    
    }
    if(winwidth > 768){
        $('.navigation').show();    
    }
});

fork of your demo

Although the advice by @Podders with toggling classes on elements and using transitions seems even better to me.