Auto-image slider with your smart phone(HTML and javaScript)
<body>
<div class="mySlides">
<img src="Url or name of the image" width="100%" height="400px"/>
</div>
<div class="mySlides">
<img src="Url or name of the image "width="100%" height="400px"/>
</div>
<div class="mySlides">
<img src="Url or next of the image" width="100%" height="400px"/>
</div>
<script>
var slideIndex = 0;
showSlides();
function showSlides() {
var i;
var slides = document.getElementsByClassName("mySlides");
for (i = 0; i < slides.length; i++) {
slides[i].style.display= "none";
}
slideIndex++;
if (slideIndex > slides.length) {slideIndex = 1}
slides[slideIndex-1].style.display = "block";
setTimeout(showSlides, 4000);
}
</script>
Comments
Post a Comment