Open a new file and save it as "animated_jpg.htm" then place the following script inside HEAD section of the HTML document:
We start by initializing a global variable c that serves as a counter and is also a part of the image name. After preloading the images (a1.jpg, a2.jpg, a3.jpg, a4.jpg and a5.jpg), we define a function disp_img() that changes the source of images named ani. The function also checks the value of variable c, assigning it a value of 1 if its value exceeds 5. The variable is also incremented each time the function is called. The function is called after every 1 second (1000 milliseconds) with the setInterval() method.
You can customize the script and create .jpg slide-shows easily.
Also Note: You must have five(5) images named "a1.jpg", "a2.jpg", "a3.jpg", "a4.jpg" and "a5.jpg" repectively, in the same directory(folder) you saved the "animated_jpg.htm" file if you realy want the above code to function acurately as expected.
For you to answer this post, you have to register your profile on this platform and log in. If registered, kindly