I have a div that is positioned about 100px from the top of the browser window. When the user scrolls down, I want the div to stay where it is
div
hey you can do like this :
var distance = $('.yourclass').offset().top; $(window).scroll(function() { if ( $(this).scrollTop() >= distance ) { console.log('is in top'); } else { console.log('is not in top'); } });