Monday, May 16, 2011

VB.NET Image SlideShow

 //For 3 images
<head runat="server">
<script type="text/javascript">
var image1=new Image()
image1.src="images/lab/DSC_0024.jpg"
var image2=new Image()
image2.src="images/lab/DSC_0018V.jpg"
var image3=new Image()
</script>
</head>
 //default image
<img alt="" src="~images/class/DSC_0223G.jpg" name="slide" width="333" height="140"/>      
<script type="text/javascript" >
var step=1
function slideit(){
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<3)
step++
else
step=1
setTimeout("slideit()",2000)     //for 2 seconds
}
slideit()
</script>                         

No comments: