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

138
Vistas
Animate image "roll" using JavaScript

In NumPy, there is a function called roll. The documentation describes it as follows:

Roll array elements along a given axis.

Elements that roll beyond the last position are re-introduced at the first.

Concretely, calling roll on an image could produce the following shifted version:

enter image description here

My question is how to achieve the same effect in JavaScript for arbitrary shift values along the width and height axes and how to make it animatable, such that one can see the transition from the original image to the shifted version.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

So the answer is embarrassingly simple. It can be achieved like so:

#imageDiv {
  background-image: url(the_image.png);
  background-repeat: repeat;
}

After which you can simply animate the background-position property on imageDiv (for instance background-position: 42px 69px).

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