title: Change a figure in a script depending on the width of the screen
body: <p>I simply have the following script, if you look after the <code>$('html,body').animate({</code> on line 9 you will see <code>scrollTop: target.offset().top - 95 }, 700);</code> - The question is, how would I change the figure <strong>95</strong> (it's after offset().top XX) When the screen width is under 1030px?</p>
  
  <p>I tried to add this line of code and play around it, but it won't work - I don't know what I am doing wrong. <code>if (width &lt;= 1030) {</code></p>
  
  <p>Here is the Script: </p>
  
  <pre><code>//Menu Scrolling To Sections//
      $(document).ready(function () {
      $('a[href*=#]:not([href=#])').click(function() {
      if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
          || location.hostname == this.hostname) {
  
          var target = $(this.hash);
          target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  
      if (target.length) {
          $('html,body').animate({
          scrollTop: target.offset().top - 95 }, 700);
      return false;
      }}});});
  </code></pre>