Create a Slideshow using Jquery

Ersudeep13
Posted by Ersudeep13 under jQuery category on | Points: 40 | Views : 609
Add a page to the website, take a Image Control on it and within HTML source of the page with in the head section write the following jquery code

<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
$(document).ready(function ()
{
var Images=['Images/Desert.jpg','Images/LightHouse.jpg','Images/penguins.jpg','Images/Tulips.jpg'];
var count = Images.length;
var Image = $('img[id$ = Image1]')
Image.attr('src',Images[count-1]);
setInternal(slideshow,3000);
function slideshow()
{
Image.fade_out('slow',function()
{
Image.attr('src',Images[(Images.length++)%count]).fadeIn('slow');
}
});
</script>
</head>
</html>

Comments or Responses

Login to post response