When I am viewing the code in action, there are no problems. But as soon as I spend some time at another browser tab, then return to the code in action, the timing/speed is too fast.
Here’s the jQuery:
var divId = 1;
var lp = 0;
$(document).ready(function (){
setInterval(function()
{
//<![CDATA[
if(divId < 6)
{
$('.main-banner').animate({ left: lp },400);
$(".first-icon-inner").removeClass("active-icon");
$("#banner-"+divId+" div:first").addClass('active-icon');
divId++;
lp-=550;
}
else
{
lp = 0;
divId=1;
$('.main-banner').animate({ left: lp },400);
$(".first-icon-inner").removeClass("active-icon");
$("#banner-"+divId+" div:first").addClass('active-icon');
}
//]]>
}, 3400);
});
There is a bug with jQuery < 1.6.3 … extract from jQuery 1.6.3 release notes :
I suggest that you update to a more recent version … ie jQuery => 1.6.3