Jquery MoreThan or LessThan
<p>I'm trying to create a responsive website with a fixed navigation only when the document width is above 769px.</p>

<p>I've got the following code which works fine when i test it using alerts to say whether the window is bigger than the size or lower than the size when re sizing.</p>

<p>However when i add my sticky header script into the else statement it doesn't work and i cant figure out why. </p>

<p>Can anyone point me in the right direction.</p>

<p>Thanks</p>

<p>This is the window size statement:</p>

<pre><code> $(window).resize(function() {
 if ($(window).width() &lt; 769) {
 alert('Less than 769');
 }
 else {
 alert('More than 769');
 }
 });​
</code></pre>

<p>And this is the code I'm trying to use if the window width is bigger than 769:</p>

<pre><code>var aboveHeight = $('header').outerHeight();

$(window).scroll(function() {

    if ($(window).scrollTop() &gt; aboveHeight) {

        $('nav').addClass('fixed').css('top', '0').next().css('padding-top', '99px');
    } else {

        $('nav').removeClass('fixed').next().css('padding-top', '0');
    }
});
</code></pre>

<p>Thanks</p>
