kenny kenny - 1 year ago 106
CSS Question

slideToggle has a rubber band effect on my ul slideToggle (jQuery help)

My mobile menu has a jquery function of slideToggle when the window browser is smaller than

x. However, when the icon is clicked it slides down the
, but immediately slides it back up.

Here's what I'm talking about

Answer Source

Just comment or delete this line:

$(this).toggleClass('.trigger-expand').css('display', '');

Now if you want to change some css when the browser size is changing and is larger than 600px use this method:

$(window).on('resize', function(){
      var win = $(this); //this = window
      if (win.width() > 600) { 
         /* The window is larger than 600px 
            change you css style here */ 
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download