nk-o / jarallax

Parallax scrolling for modern browsers
https://jarallax.nkdev.info
MIT License
1.39k stars 214 forks source link

Making another background image fully dissapear #164

Closed shafickr closed 4 years ago

shafickr commented 4 years ago

Issue description:

Screenshot 2020-01-31 at 12 49 55

I'm using jarallax with nuxt.js framework. when I scrolled to bottom it worked fine, but when I scrolled back to top, there was another background image appear. How can I fix it?

Version used:

(Did you try using the develop branch from GitHub? There's a chance your issue has already been addressed there)

Code to reproduce the issue (HTML blocks + JavaScript initialization)

nk-o commented 4 years ago

Hi.

May I see any online example? Codepen will be perfect to check the bug.

shafickr commented 4 years ago

This is the preview url: https://nifty-sinoussi-055df5.netlify.com/

nk-o commented 4 years ago

I see you used custom styles for images. Jarallax is calculating only when image container is in the viewport, but since you added styles like this position: fixed!important; to the image, this breaks everything. https://github.com/nk-o/jarallax/blob/master/src/jarallax.esm.js#L641-L649

I don't think I may help you with your custom code, this is not a Jarallax issue.