Mobile CSS Bar in landscape doesn't work
===

I have CSS bars, instead of links, on my mobile web page. It works fine in portraits but defaults to to links in landscape view. I use a little bit of jQuery to do this but I can't figure out why it doesn't work in landscape. I simplified the code to force it to work but that didn't help. Could someone help me with this. The jQuery code is below.

    if (window.innerWidth && window.innerWidth <= 600) { 
    $(document).ready(function(){
        $('#header ul').addClass('show'); 
    }); 
    }
    else {
       $(document).ready(function () {
        $('#header ul').addClass('show');
}