javaScript image slider
Hi friends , i am your friend manoj chauhan . Today discussion is how to create image slider using html , css and javascript only. we know mostly website use image slider to create attractive and inter-attractive website.
This is a main part of websites every designer know that things that's reason i told you how to create image slider in simple coding.
<body>
<img src="image source" id="social" onclick="change()">
</body>
<script>
var image_tracker='v'; // v is image name first latter
function change(){ // function use for a
var image = document.getElementById('social'); // image id call in function
if(image_tracker =='v'){ // i used if function for multile possibility in function
// image name first latter v is not found then second call
image.src='hair.jpg'; // second image call in function
image_tracker ='h'; // same process in function again
}else
{
image.src ='vector.png';
image_tracker='v';
}
}
setInterval("change()",3000) // used for mutiple time function call
</script>