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

132
Views
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 answers
Answer question

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 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!