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

Popular posts from this blog

how to insert data php javascript mysql with multiple array session 2 -

multithreading - Exception in Application constructor -

windows - CertCreateCertificateContext returns CRYPT_E_ASN1_BADTAG / 8009310b -