title: How to detect scroll inside “body” and get rid of scrollTop() returns 0
body: <p>I have set a Scroll event to trigger fade out or fade in effect for "$("#btn")" , but I am not even able to detect the scroll event when its is scrolled, when check the value of scroll it return as 0, due to which it is not reflecting anything.</p>
  
  <p><strong>Issue: Not able to detect any kind of scroll event and not able to get scrolled values</strong>  </p>
  
  <p>Here is the which I tried</p>
  
  <p><a href="https://jsfiddle.net/evwrs0jq/1/" rel="nofollow noreferrer">https://jsfiddle.net/evwrs0jq/1/</a></p>
  
  <pre><code>$(document).ready(function(){
  
  $("body").on("scroll", function(){
  alert();
          var currentScroll = $(this).scrollTop()
          var BtnAction = $("#btn");
          if (currentScroll &gt; offset) {
              BtnAction.fadeOut(duration);
          } else {
              BtnAction.fadeIn(duration);
          }
          offset = currentScroll;
        });
  });
  </code></pre>