Use jQuery to Detect if User has Scrolled to the Bottom or Top of a Page
february 2012 by ChrisLTD
$(function () {
var $win = $(window);
$win.scroll(function () {
if ($win.scrollTop() == 0)
alert('Scrolled to Page Top');
else if ($win.height() + $win.scrollTop()
== $(document).height()) {
alert('Scrolled to Page Bottom');
}
});
});
ios
jquery
scroll
tech
var $win = $(window);
$win.scroll(function () {
if ($win.scrollTop() == 0)
alert('Scrolled to Page Top');
else if ($win.height() + $win.scrollTop()
== $(document).height()) {
alert('Scrolled to Page Bottom');
}
});
});
february 2012 by ChrisLTD
related tags
accordion ⊕ ajax ⊕ anchor ⊕ audio ⊕ background ⊕ carousel ⊕ code ⊕ design ⊕ dropdown ⊕ fallback ⊕ flash ⊕ fluid ⊕ gallery ⊕ html5 ⊕ ios ⊕ javascript ⊕ jquery ⊖ lightbox ⊕ modal ⊕ multiple ⊕ onepage ⊕ photography ⊕ plugin ⊕ responsive ⊕ scroll ⊕ simple ⊕ slider ⊕ slideshow ⊕ smooth ⊕ tech ⊕ themeable ⊕ touch ⊕ validation ⊕ video ⊕ vimeo ⊕ youtube ⊕Copy this bookmark: