Jan 18, 2016
Since you’re already using jQuery, just use .each() to iterate through the array and append the elements to the container element, #stretchParent.
As for the function itself, i’d suggest using setInterval. Set the delay to whatever you want.
The function increases the z-index of the first element and then fades it out and appends it to the end of the container element. The next line simply makes the next element visible while decreasing its z-index to ensure that it will appear behind the current image.