javascript - The code does not work in FF and IE? -


$(window).on('scroll.toelement', function (e) {     var s_top = $("body").scrolltop();     var el = $("#popular").offset().top;     if(s_top > el){         console.log('test')         $(window).off('scroll.toelement');     } }); 

the chrome , opera works in ff , ie not work. how solve problem, tell me? need function console.log() worked 1 time achievement of desired block. 2 browsers wrote ok, in other 2 - not working. , can not understand why. example

i found solution: replaced var s_top = $("body").scrolltop(); on var s_top = $(window).scrolltop();

example


Comments

Popular posts from this blog

amazon web services - S3 Pre-signed POST validate file type? -

c# - Check Keyboard Input Winforms -