Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda