title: tablet orientation change with jquery and modernizr
body: <p>So I have a nav menu which changes style when viewing tablets in portrait or landscape. It collapses the last few menu items into another drop down menu. Yet the menu doesn't update upon orientation change, only doing so after a refresh. </p>
  
  <p>Jquery Modernizr code:    </p>
  
  <pre><code>if(Modernizr.mq('(max-device-width: 800px) and (orientation: portrait)')){
      // portrait stuff
          // unhides last few menu items
          $('#menu-primary-items &gt; li:nth-last-child(-n+3)').css('display', 'block');
  
          // remove hide and first child class originally assigned to it from it's ul parent
          // then add the more list item to the end of the nav menu
          $('.moreItem').removeClass('hide first-child').appendTo('#menu-primary-items');
  
          // grab the last two items of the nav menu and insert into the more list item menu
          $('.topNavigation .toplevel').slice(-2).appendTo('.moreMenu');
      } 
  </code></pre>
  
  <p>Any suggestions??</p>