Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- somebigcontents
- <div data-scrollpixel="testimonal">
- //some html
- </div>
- some other contents
- <div data-scrollpixel="footer">
- //some html
- </div>
- $(window).scroll(function() {
- var hT = $('[data-scrollpixel]').offset().top,
- hH = $('[data-scrollpixel]').outerHeight(),
- wH = $(window).height(),
- wS = $(this).scrollTop();
- if (wS > (hT+hH-wH)){
- $(this).data("scrollpixel");
- }
- });
Add Comment
Please, Sign In to add comment