title: How to execute some piece of jquery code only when the viewport is above 1000px in WordPress
body: <p>I need to execute some jquery code here when the viewport is above 1000px and above only but I can't get it to work. Please someone tell me what I'm doing wrong.</p>
  
  <pre class="lang-js prettyprint-override"><code>jQuery(document).ready(function($) {
    $(window).on('scroll', function() {
      var y = $(window).scrollTop();
      var width = $(window).innerWidth();
  
      if (window.location.pathname == '/') {
        if ($(window).innerWidth() &gt; 1000 &amp;&amp; y &gt; 0) {
          $('#top').fadeIn();
          $('#header-space').fadeIn();
        } else {
          $('#top').fadeOut();
          $('#header-space').fadeOut();
        }
      } else {}
    });
  });
  </code></pre>