Can't remove style with Jquery

Can't remove style with Jquery

Hi Guys,

I'm trying to figure out how to create a responsive menu here:

I've been using this tutorial:

It all works apart from one bit which I cannot figure out... When you resize the browser and expand the menu, and then hide the menu, the <ul> has display:none applied. The idea is that if the window is then expanded, some script removes that style:

  1. $(window).resize(function(){
  2.     var w = $(window).width();
  3.     if(w > 320 && menu.is(':hidden')) {
  4.         menu.removeAttr('style');
  5.     }
  6. }); 

But it doesn't. The attribute remains. 

What am I doing wrong?

Thanks in advance for any advice.