Tuesday, March 24, 2009

coding for Banner Animation in Jquery

imgc=1;
timer="";
$(document).ready(function(){
});
function image()
{
if($("#slideshow").html()!="Stop")
{
$("#slideshow").html("Stop");
timer=window.setInterval("slideshow()",3000);
}
else
{
$("#slideshow").html("Slideshow");
window.clearInterval(timer);
}
}



function slideshow()
{
if(imgc<11)
{
$("#img").fadeOut({complete:function(){$(this).attr("src","./images/image"+imgc+".jpg").fadeIn();}});
imgc++;
}
else
{
imgc=1;
$("#img").fadeOut({complete:function(){$(this).attr("src","./images/image"+imgc+".jpg").fadeIn();}});
}
}

No comments: