I added the parallax.js jQuery plugin and the effect works, but not properly. The background is zoomed in and the image is glitchy on scroll. I added additional variables listed in the documentation to fix those issues, and they work as expected. However, unexpectedly they also break my content which is created dynamically using JS in the '#sections' div, an empty div populated with a JavaScript object?
function parallaxBackground (){
var yPos = -(($window.scrollTop() - $this.offset().top) / 5);// Scroll speed
var coords = '1% '+ yPos + 'px';// Background position
$this.css({ backgroundPosition: coords });// Move the background
}
parallaxBackground();//Call parallaxBackground function
Any idea why this function would erase HTML content created using JS? The rest of the JS still works, its just the '#sections' div that stops working. Scroll, reveal, and hover effects are still intact. Here is a link to the code.
https://gist.github.com/flyspaceage/075dcf3a6d6bd65edf0f456036eb9bd8
Please read comment by FlySpaceAge for more info.