title: Detect if page is scrolled on document load
body: <p>I'm using the <code>scrollTop</code> to detect if the users scrolls then <code>fadeIn</code> an element:</p>
  
  <pre><code>$(document).ready(function() {
      // scroll to top
      $(window).scroll(function() {
          if ($(this).scrollTop() &gt;= 700) { // if page is scrolled more than 700px
              $('#return-to-top').fadeIn(200);
          } else {
              $('#return-to-top').fadeOut(200);
          }
      });
  });
  </code></pre>
  
  <p>It works well if the user loads the page and then scroll, but if the user is already below the 700px and reload or goes back to the same page the element doesn't <code>fadeIn</code> automatically on document load. It seems that it is not detecting the page is already scrolled.</p>
  
  <p>Any idea what could be the problem with my code?</p>