'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();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
