Event, when i scrolled 2/3 of page, not running
Hi all.
I have next issue: I need run some event, when I scrolled 3/4 page. I do that:
var limit_height = 3/4 * jQuery('body').height();
|
jQuery(window).scroll(function() { |
|
if (jQuery(window).scrollTop() > limit_height) { |
|
alert('You are scrolled 3/4 of page!'); |
So, when I look on console(I check current scrollTop), I have more times, when current scrollTop < 3/4 * body_height(so limit_height). Therefore event not run.
Please help me, where I have error, if it's possible.
Thanks!