Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <title>Display array ( pics )</title>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width">
- <style>
- #image {
- width: 200px;
- height: 200px;
- border: 5px solid;
- position: absolute;
- top: 10px;
- left: 10px;
- }
- #demo {
- width: 200px;
- height: 200px;
- border: 5px solid black;
- display: none;
- font-size: 25px;
- font-family: arial black;
- color: red;
- display: grid;
- place-items: center;
- position: absolute;
- top: 10px;
- left: 10px;
- text-align: center;
- }
- </style>
- </head>
- <body>
- <span id='demo'>
- <span>No more pics to show</span>
- </span>
- <img id='image'>
- <script>
- i = 0;
- array = [
- "https://image.freepik.com/free-vector/girl-with-balloons-cartoon_23-2147502477.jpg",
- "https://preview.free3d.com/img/2014/03/2202346574644774419/qjjknje9-900.jpg",
- "https://www.clipartkey.com/mpngs/m/4-41440_potato-clipart-for-download-free-potato-cartoon.png",
- "https://preview.free3d.com/img/2014/03/2202346574644774419/qalvpuff-900.jpg",
- "https://images.all-free-download.com/images/graphicthumb/potato_sale_drawing_female_seller_display_icons_6832084.jpg",
- "https://www.kindpng.com/picc/m/104-1044929_jacket-potato-cartoon-character-free-picture-potato-with.png",
- "https://preview.free3d.com/img/2014/03/2202346574644774419/q2j4fh4w-900.jpg",
- "https://images.all-free-download.com/images/graphicthumb/girls_balloons_background_colorful_cartoon_drawing_6827688.jpg",
- "https://vectorified.com/image/potato-vector-1.jpg"
- ];
- image.src = array[i];
- function change() {
- stopInterval = setInterval(function () {
- image.src = array[i];
- i++;
- if (i == array.length) {
- clearInterval(stopInterval);
- setTimeout(function () {
- image.style.display = "none";
- }, 1000);
- }
- }, 1000);
- }
- change();
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment