Jjack Jjack - 1 year ago 112
CSS Question

JQuery Scroll Listener

To handle parallax scrolling and dynamic elements appearing on the page depending on how far the user has scrolled, I am using the JQuery scroll listener method.

$(window).scroll(function(){});

The one problem I am having is that this method is only triggered when the user reaches the bottom of the page or the top of the page: there is no "live" scroll tracking. Is there anyway to accomplish tracking the "live" scroll and not when the user reaches the bottom of the page? My code is as follows.

$(document).ready(function() {
$(window).scroll(function() {
$("#article").append("<div>Did scroll</div>");
});
});


The did scroll will only appear when the user reaches the top or bottom.

EDIT:

And I have tired to place the code outside the
$(document).ready();
. Same result presented itself.

Answer Source

It works correctly, probable you are just missing some css

here's an example http://jsfiddle.net/orlando/0mqc2skk/

$(document).ready(function() {
    $(window).scroll(function() {
        $("#article").append("<div>Did scroll</div>");
    });
});
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download