How to add slider in website
1 add the java script in head section<head>
<script type="text/javascript">
var wall=0;
function slider()
{
images=new Array();
images[0]='image/promo-students.jpg';
images[1]='image/promo-students.jpg';
images[2]='image/promo-students.jpg';
images[3]='image/4.jpg';
images[4]='image/4.jpg';
images[5]='image/4.jpg';
images[6]='image/7.jpg';
images[7]='image/8.jpg';
images[8]='image/9.jpg';
images[9]='image/1.jpg';
document.getElementById('img_sl').src=images[wall];
if(wall<9)
wall++;
else
wall=0;
setTimeout(slider,1000);
}
</script>
</head>
and then add this code in <body> section
<body onLoad="slider()">
and then put the slider id on location where you want to run slider images.
<div class="middle">
<img src="image/promo-students.jpg" width="1000" height="300" id="img_sl"/>
Comments
Post a Comment