Giter VIP home page Giter VIP logo

Comments (8)

johanneslamers avatar johanneslamers commented on June 21, 2024 8

Would be awesome if the parallax items stop transforming if they are out of the viewport. That would make this script much lighter and faster. No more unnecessary calculations and paints.

from rellax.

 avatar commented on June 21, 2024 5

I may have gotten confused with this... but surely parallax relative to the viewport is essential? If I have a large page, then anything at the bottom of the page is going to end up being complete out of place by the time you scroll to its position. is there another way of achieving this?

from rellax.

moeamaya avatar moeamaya commented on June 21, 2024 4

@toddpadwick Yup, we have the centering: true feature which centers your element in the viewport when you scroll to that point.

from rellax.

moeamaya avatar moeamaya commented on June 21, 2024 2

Hey no worries glad you picked us! Feel free to email or tweet us when you launch your parallax project, we'll promote it!

from rellax.

envieme avatar envieme commented on June 21, 2024

I am sorry for posting this. I did figure out I had to change my HTML a bit to prevent lazyloading of images and it works beautifully now! Thank you for the plugin.

But is there a way to make it work with lazy loading images that have rellax applied to them? What happens is the first time a page loads and the images in the bottom of the feed are displaced by quite a bit when they come into viewport. But the second refresh of the same page renders them properly. So I am guessing it has to do with size information regarding the images?

from rellax.

p-realinho avatar p-realinho commented on June 21, 2024

Hey. Thanks for using the plugin :)

If you're loading all the image at once I think the solution for #52 could work for you.
If you're using lazy-loading, infinite scrolling, etc, you'll probably have to wait for #62 to get implemented. 😕

from rellax.

moeamaya avatar moeamaya commented on June 21, 2024

This is conceptually a great idea, but ultimately doesn't work in practice.

Because parallax by definition depends on your vertical scroll position, it doesn't make sense to not do the calculation on scroll. Even with 1,000 rellax elements, an iphone 5s doesn't stutter at all, so if your website is having performance issues I'd suggest optimizing elsewhere.

@johanneslamers Since we're using requestAnimationFrame and the elements are out of the viewport, painting is negligible.

from rellax.

 avatar commented on June 21, 2024

haha I knew I'd got something wrong somehow as it seemed odd not having it. Thanks @moeamaya . Great plugin... so many over bloated or abandoned parallax plugins out there and also very few seem to have a good destroy function which was the main reason I chose yours. 👍

from rellax.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.