title: jquery get image offset right on horizontal scrolling
body: <p>I'm using on my website jQuery Mousewheel to have an horizontal scrolling.</p>
  
  <p>I'm trying to get the offset right of an image when scrolling.</p>
  
  <p>when using $(document).ready it works, but when I try to use $(window).scroll I dont have the right offset and the offset is not updated when scrolling.</p>
  
  <p>any ideas ?</p>
  
  <p>here is my code :</p>
  
  <pre><code>$(document).ready(function() {
  
    $('html, body, *').mousewheel(function(e, delta) {
  
       this.scrollLeft -= (delta);
       e.preventDefault();
    });
  
  });
  
  $(window).scroll(function() {
  
    var $image = $(".image_test");
    var $rt = ($("body").width() - ($image.offset().left + $image.outerWidth()));
  
    console.log($rt);
  
  });
  </code></pre>
  
  <p>here is a Jsfiddle : </p>
  
  <p><a href="https://jsfiddle.net/deapzuc4/" rel="nofollow noreferrer">https://jsfiddle.net/deapzuc4/</a></p>
  
  <p>thanks</p>