title: Execute a function after scroll to a div only 1 time
body: <p>I want to execute a function only 1 time after scroll to a certain div, but the way i do it below, it keeps triggering that function after scroll.</p>
  
  <pre><code>$(window).scroll(function() {
                  var hT = $('#test').offset().top,
                  hH = $('#test').outerHeight(),
                  wH = $(window).height(),
                  wS = $(this).scrollTop();
                  if ((wS &gt;= (hT+hH-wH)) &amp;&amp; (i &lt; 4)){
                    myfunction();
                  }
                });
  </code></pre>
  
  <p>I want myfunction() to be executed only 1 time <br>
  Thanks for the help</p>