Ich versuche, zwei Diashows gleichzeitig mit der gleichen Geschwindigkeit zu spielen. Ich habe Slide2 funktioniert, aber meine Slide1 funktioniert überhaupt nicht. Ich habe mich gefragt, wie ich das beheben könnte.HTML, CSS. Versuchen, zwei Diashows gleichzeitig zu spielen
HTML-Code:
<!DOCTYPE HTML>
<html lang="en">
<link rel="stylesheet" href="index.css">
<head>
<title> Welcome to Sunsplash Festival </title>
</style>
<body>
<audio controls>
<source src="ReadyForWar.mp3" type="audio/mpeg">
</audio>
<div>
<nav>
<ul>
<li> <a href="index.html">Home</a> </li>
<li> <a href="tickets.html">Tickets</a> </li>
<li> <a href="acts.html">Performers</a> </li>
<li> <a href="location.html">Location</a> </li>sitemap.html"
<li> <a href="facilities.html">Facilities</a> </li>
</ul>
</nav>
</div>
<div>
<img class="Slide2" img src="img/b.jpg" alt="Festival Night">
<img class="Slide2" img src="img/c.jpg" alt="Festival Party">
</div>
<div>
<img class="Slide1" img src="img/a.jpg" alt="Festival Girl">
<img class="Slide1" img src="img/MusicPower.jpg" alt="Through The Power Of Music">
</div>
<div>
<script>
var myIndex = 0;
carousel();
function carousel() {
var i;
var x = document.getElementsByClassName("Slide2");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) {myIndex = 1}
x[myIndex-1].style.display = "block";
setTimeout(carousel, 1500);
}
</script>
</div>
<div>
<script>
var myIndex = 0;
carouse2();
function carouse2() {
var i;
var x = document/getElementsByClassName("Slide1");
for (i = 0; i < x.length; i++) {
x[i].style.display = "none";
}
myIndex++;
if (myIndex > x.length) (myIndex = 1)
x[myIndex-1].style.display = "block";
setTimeout(carouse2, 2000);
}
</script>
<div>
<div>
<footer>
<small> Copy: 2017 Sunsplash Festival. All Rights Reserved </small>
<a href="sitemap.html" title="Links to all the pages on this website">Sitemap</a>
</footer>
</div>
</body>
</head>
</html>
CSS-Code:
.Slide1{
height: 741px;
width: 1406px;
}
.Slide2{
height: 741px;
width: 1406px;
}
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #000000;
}
li {
float: left;
}
li a {
display: block;
color: #FFFFFF;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #D3D3D3;
}
body {
background-color: #90EE90;
]
enter code here