I have an array of urls containing locations of pictures on page load. I need to show them to the user in an <asp:img>
with a 5 second time interval.
Can this be done with <asp:timer>
, or is there any way to do it?
I have an array of urls containing locations of pictures on page load. I need to show them to the user in an <asp:img>
with a 5 second time interval.
Can this be done with <asp:timer>
, or is there any way to do it?
Try using a javascript plugin for that. Coin slider is great for this.
<asp:Image ID="image1" runat="server">
<script type="text/javascript">
var imgArray = ['1.png','2.png','3.png','4.png','5.png','6.png','7.png','8.png','9.png','10.png'], imgToShow = 0;
function showImage() {
if(imgToShow > imgArray.length - 1)
imgToShow = 0;
document.getElementById("<%= image1.ClientID %>").src = imgArray[imgToShow++];
}
showImage();
window.setInterval(showImage, 5000);
</script>