Jump to content
Search Community

Why does image paralax not work in this demo and how to enable it?

MarkTan test
Moderator Tag

Recommended Posts

I would like to enable parallax for my images and have smooth scrolling using Locomotive.

 

Please tell me what is wrong with my example and how can I add a parallax there?

 

...

P.S. Open the full screen version to display the images correctly.

 

Link to comment
Share on other sites

Hey @MarkTan

 

It probably doesn't work, because you are doing nothing to your images with that ScrollTrigger-tween.

 

I applied a translation on the y-axis to the images on scroll (and changed the tween to a .from() tween) for example, and it seeems to do what it's supposed to.

 

See the Pen 23814605940ae3c51ef1476bdd30ca53 by akapowl (@akapowl) on CodePen

 

 

 

Also, codepen told me to pinch you in the leg, when I couldn't view your pen in fullpage view ;) ...so consider this done.

And btw, welcome to the forums :) 

 

Hope this helps.

Cheers

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...