-
-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onScroll method with force = true #13
Comments
I think I found an even better solution. It would be so great if we had a
Sometimes, like in the situation with a carousel with hidden slides, there might be several parallax instances inside one container that are hidden but have to be recalculated onScroll. We could check if the container is in the viewport, instead of checking each instance individually. What do you think? |
Your solution will works for carousels with 1 visible item, but what if visible 2 or more items in the row? In this scenario will be calculated wrong image sizes. |
@nk-o, it's exactly what I'm trying to explain: If we had |
ah, I understand. |
I think an option would be better. It can be called something else, not Then jarallax will check if the given element is in viewport and not the jarallax container itself. What do you think? |
Only 1 thing. If we add this option elementInViewport: '.carousel'. Which of available carousels should use jarallax? On the page we can have more then 1 item with .carousel classname. We can use jQuery / dom for elementInViewport option. I think this example will work for carousels:
Today I will add this option and let you know. |
@nk-o, great suggestion. Looking forward to it! |
You can try new jarallax version |
Thanks a lot, works like a charm! Please correct the docs though: the option is |
how would this work with the data-attribute?
|
@robojiannis Did you find out how to use it with data attributes |
I'm trying to get parallax on slides inside a carousel.
Since there are slides that are out of viewport, Jarallax doesn't recalculate them on scroll. Hence I'm triggering
carouselSlide.jarallax('onScroll');
after each slide change. But it doesn't effect slides outside the viewport.Is there a way to force recalculation of slides outside the viewport with
carouselSlide.jarallax('onScroll');
by enablingforce: true
somehow?The text was updated successfully, but these errors were encountered: