Need jquery slideshow to stop after 2 loops
I'm fairly new to using jquery and have developed a slideshow for a client. He wants the slideshow to only loop through 2 times and then stop on the final slide. I would appreciate help from anyone!
URL: http://www.abbeyroaddjs.com/ny/index.shtml
Here is the code I have so far:
<script type="text/javascript">
//Main jQuery script.
Slider();
function Slider()
{
$(".slider #1").show('fade',1000);
$(".slider #1").delay(3000).hide("fade", { direction: "left" }, 1000);
var sc = $(".slider img").size();
var count = 2;
setInterval(function()
{
$(".slider #" + count).show("fade", { direction: "right" }, 1000);
$(".slider #" + count).delay(3000).hide("fade", { direction: "left" }, 1000);
if (count == sc)
{
count = 1;
}
else
{
count = count + 1;
}
},3000);
}
</script>