javascript - can this be done without jquery? -
how can show alert when have scrolled right 300px?
$('.container').scroll(function () { if ($(this).scroll() === 300) { // alert("you've scrolled 300 pixels."); } }); can getting callback without using jquery?
you can bind onscroll method:
window.onscroll = function() { if (window.pageyoffset == 300) { alert("you've scrolled 300 pixels."); } };
Comments
Post a Comment