Rotate images with ASP .Net/Jquery
Im a little stuck with this task which i thought was simple. I have an ASP .Net form with some JQuery to change the image. At first i thought it was the array of images not being found in my project but now im not so sure what the issue could be. Here is my code:
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="Site.master.vb" Inherits="TempCollection.Site" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js" type="text/javascript">
$(document).ready(function () {
// Handler for .ready() called.
var imgs = ['http://i.s-microsoft.com/global/ImageStore/PublishingImages/logos/hp/logo-lg-1x.png',
'http://i.s-microsoft.com/global/ImageStore/PublishingImages/logos/hp/test.jpg'];
var cnt = imgs.length;
setInterval(Slider, 3000);
function Slider() {
$('img[id*=imageSlide]').fadeOut("slow", function () {
$(this).attr('src', imgs[(imgs.length++) % cnt]).fadeIn("slow");
});
}
});
</script>
</asp:ContentPlaceHolder>
</head>
<body>
<form id="form1" runat="server">
<div>
Test
<img id="imageSlide" alt="" src="" />
</div>
<asp:ContentPlaceHolder ID="cph" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
Im using an internet image but that doesnt even display. Can anyone shed any light on how this should be done?
Thanks