Skip to content

Commit f4a1d9b

Browse files
committed
slideshow
1 parent 571357b commit f4a1d9b

File tree

6 files changed

+4
-4
lines changed

6 files changed

+4
-4
lines changed

image/beach.jpg

-441 KB
Binary file not shown.

image/beach.png

907 KB
Loading

image/castle.jfif

-449 KB
Binary file not shown.

image/castle.png

1.07 MB
Loading

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<main>
2929
<mdui-card id="main-card">
3030
<div class="main-item">
31-
<a id="slider"><img height="40%" alt="slide show" id="slide"></a>
31+
<a id="slider"><img style="object-fit: contain" alt="slide show" id="slide"></a>
3232
</div>
3333
<div><mdui-divider vertical></mdui-divider></div>
3434
<div class="main-item">

js/script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
const imgs = ["image/beach.jpg", "image/castle.jfif", "image/boatoff.png"];
1+
const imgs = ["image/beach.png", "image/castle.png", "image/boatoff.png"];
22
const links = ["#", "#", "game/boatoff"];
33
document.addEventListener("DOMContentLoaded", function () {
44
let cnt = 0;
55
setInterval(function () {
66
document.getElementById("slide").src = imgs[cnt];
7-
document.getElementById("slided").src = links[cnt];
7+
document.getElementById("slider").src = links[cnt];
88
cnt = (cnt + 1) % imgs.length;
9-
}, 3000);
9+
}, 1000);
1010
});

0 commit comments

Comments
 (0)