pixelcog / parallax.js

Simple parallax scrolling effect inspired by Spotify.com implemented as a jQuery plugin
MIT License
3.53k stars 840 forks source link

Not working with dynamic content (new parallax-window added) #285

Open RBFraphael opened 5 years ago

RBFraphael commented 5 years ago

I'm creating a blog with infinity scoll and a full-width featued image. When user scrolls to page's bottom, it load next post with ajax.

Now, I'm trying to add parallax in featured images, but it's not working when new posts loads. I've tried to run $(".parallax-window").parallax() just after loading new post, but parallax bugs and shows only 50% of featured images container's height.

awesomedan93 commented 5 years ago

Try this after you are changing something in DOM jQuery(window).trigger('resize').trigger('scroll'); or read this https://github.com/pixelcog/parallax.js#notes