Check out the complete example on JSFiddle!
I am attempting to trigger a JQuery event that will add a class to a div and set an inline style (such as the value for top location offset) when the user scrolls down the page to a specified scrollTop() value (when the number of pixels scrolled down surpasses the viewport height).
Unfortunately, it seems like the JQuery event is not triggering at all.
$(window).bind('scroll', function() {
...
});
What I have attempted:
Based on my research from this SO thread, I learned that the element we bind the event to should not be hidden with overflow property. My background image slideshow has position:fixed; so I also tried $("div.firstPage").bind(...) and $("div.header-menu-container-nav").bind(...) but without success.
Note: I understand that the example in the JSFiddle might seem complex. However, it provides complete CSS and markup details, so I decided not to simplify it further.