How to do slide show in website using java script ? - Learn With Riwash

Breaking

Learn With Riwash

learn with riwash learn with riwash is the personal blog/youtube channel that provide best knowledge of software development. Here we give complate trainning of techonology as will as build software. We teach you related to web developing and programming in html,javascript,php,python,c++, c#, java programming ect. It is not a complate teaching siti like W3schools but it it a blog where we give code that help you to become better programmer.

ads

Post Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Sunday, January 7, 2018

How to do slide show in website using java script ?

How to do slide show in website ?
Article by Technical Riwash
In this article I am going to give and idea that how to do slide show in website.
Yes I think that you have some knowledge of HTML CSS and JAVASCRIPT.
Lest start
1)      First create image that you want to do slideshow.
Save it in same folder. Here I give the image name like pics01.jpg like this.
I use totally 5 images.
Put all script in side html tag
<html>
<body>
Now here we create variable

<script type="text/javascript">
var image1 new Image()
image1.src="pics01.jpg"

var image2 new Image()
image2.src="pics02.jpg"

var image3 new Image()
image3.src="pics03.jpg"

var image4 new Image()
image4.src="pics03.jpg"
var image5 new Image()
image5.src="pics03.jpg"
</script>
And here we have html code for image
<img src="img/pics01.jpg" id="sideimg" name="sideshow"/>
Now this script define the side show to images
<script type="text/javascript">
var numberImage = 1
function myslide() {
document.image.slideshow.src=evel("image"+numberImage+".src)
if(numberImage < 4 )
numberImage= numberImage + 1
else
numberImage = 1
setTimeout("myslide()", 3500)
}
myslide()
</script>
The close html tag
</body>
<html>
This are some step that how you can sideshow in site.




No comments:

Post Top Ad

Responsive Ads Here