Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

153
Views
Move images based on scroll

I'm trying to create a section where I have two Images

<img class="first">
<img class="second">

the first image is left aligned and the second one is right I want to move them from right to left and left to right based on scroll When the user scrolls down images should move to the center from left and right

Here is the code pen link: https://codepen.io/taruunn/pen/RwjQrOy

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can add key at .add(). This code, I add "first".

So it will move together.

Apply the code below.

var controller = new ScrollMagic.Controller();

var scrollHorizontal = new TimelineLite()
  .add(TweenMax.to("#scrollHorizontal1", 1, {x:'-100%'}), "first")
  .add(TweenMax.to("#scrollHorizontal2", 1, {x:'100%'}), "first");

var horizontalScroll = new ScrollMagic.Scene({
  triggerElement: "#scrollHorizontal",
  triggerHook: 'onLeave',
  duration: 3000
}).setTween(scrollHorizontal).setPin("#scrollHorizontal").addTo(controller);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!