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

174
Views
How to animate these transitions?

I'm making a image slider and I have built the two functions that can switch to the next or previous picture. Now I just need to add some animations to them. How can I add animations to appendChild? If that's even possible

btw this is the array: [img.image1, img.image2, img.image3, img.image4]

frame.appendChild(array[0])

console.log(array)

function next() {
  // remove current picture from frame
  pics.appendChild(array[0])
  array.push(array[0])

  // add new picture to frame
  frame.appendChild(array[1])
  array.shift();
  console.log(array);
}

function previous() {
  console.log(array)

 // removes current image from the frame
  pics.insertBefore(array[0], array[1])

  // adds new picture to the frame

  frame.appendChild(array[array.length -1])
  array.unshift(array[array.length - 1])
  array.pop();
}
about 4 years ago · Juan Pablo Isaza
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!