html
html
1
2
3
4
5
6
7
8
9
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<img name="slide" width="400" height="200"/>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
body{
margin:0;
padding:0;
}
img{
width:100%;
margin:0;
padding:0;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var i = 0;
var img = [];
var time = 2000;
// Image List
img[0] = "https://images.pexels.com/photos/592753/pexels-photo-592753.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940";
img[1] = "https://images.pexels.com/photos/296888/pexels-photo-296888.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940";
img[2] = "https://images.pexels.com/photos/9186/food-beans-coffee-drink.jpg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940";
function changeImg(){
document.slide.src = img[i];
if(i< img.length - 1){
i++
} else {
i = 0;
}
setTimeout("changeImg()", time);
}
window.onload=changeImg
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run