File: D:/HostingSpaces/SBogers7/bogers-tekenburo.nl/wwwroot/public/js/simpleGallery.js
var $gal = $('#simple_gallery');
var index = 0;
// Set width ul
var imgW = $('img',$gal).width();
var num = $gal.children().size();
$gal.width((num+1) * imgW);
// Append first image at the end
var first = '<li>' + $gal.children('li').eq(0).html() + '</li>';
$gal.append(first);
setInterval(nextImage,4000);
function nextImage()
{
index++;
var newW = index * -imgW;
$gal.stop().animate({ left: newW + 'px'},500,function()
{
// Callback
if(newW == (num * imgW * -1))
{
$gal.css({ left: 0 });
index = 0;
}
});
}