Какой код добавить в джаваcкрипт чтобы слайдер автоматически менялся?
http://u.to/K7TiBg
Слайдер в подвале(инфографика)
Джава скрипт в самом низу
<script>
$(document).ready(function(){
$("#infografica__").jCarouselLite({
btnNext: "#ignex",
btnPrev: "#igprev",
speed:1000,
scroll:1,
visible:3});
$("#ignex, #igprev, .slb").hover(function(){
$(this).css("backgroundPosition", "0% 100%");}
).mouseout(
function(){
if (!$(this).hasClass("slbch")){
$(this).css("backgroundPosition", "0% 0%");
}
}
);
});
function initinfog(id){
$(".slb").removeClass("slbch");
$(".slb").css("backgroundPosition", "0% 0%");
$(".slb[rel='slb"+id+"']").addClass("slbch");
$(".slb[rel='slb"+id+"']").css("backgroundPosition", "0% 100%");
lp=$('#igd').width()/2-16;
tp=$('#igd').height()/2-16;
$('#loader3').css({"top":tp, "left":lp, "display":"block"});
var i = new Image();
i.onload = function(){$('#loader3').css("display","none");
get_id('ig').src=i.src;
}
i.src = 'pics/articles/b'+id+'.jpg';
if (id==503){
$("#svml").css("display", "block");
}
else {$("#svml").css("display", "none");}
if (id==522){
$("#svml2").css("display", "block");
}
else {$("#svml2").css("display", "none");}
}
</script>
$(document).ready(function(){
$("#infografica__").jCarouselLite({
btnNext: "#ignex",
btnPrev: "#igprev",
autoPlay: "#false",
speed:1000,
scroll:1,
visible:3});
$("#ignex, #igprev, .slb").hover(function(){
$(this).css("backgroundPosition", "0% 100%");}
).mouseout(
function(){
if (!$(this).hasClass("slbch")){
$(this).css("backgroundPosition", "0% 0%");
}
}
);
});
function initinfog(id){
$(".slb").removeClass("slbch");
$(".slb").css("backgroundPosition", "0% 0%");
$(".slb[rel='slb"+id+"']").addClass("slbch");
$(".slb[rel='slb"+id+"']").css("backgroundPosition", "0% 100%");
lp=$('#igd').width()/2-16;
tp=$('#igd').height()/2-16;
$('#loader3').css({"top":tp, "left":lp, "display":"block"});
var i = new Image();
i.onload = function(){$('#loader3').css("display","none");
get_id('ig').src=i.src;
}
i.src = 'pics/articles/b'+id+'.jpg';
if (id==503){
$("#svml").css("display", "block");
}
else {$("#svml").css("display", "none");}
if (id==522){
$("#svml2").css("display", "block");
}
else {$("#svml2").css("display", "none");}
}
</script>
<script language="JavaScript" type="text/javascript">
var image_count = 3;
var interval = 3000;
var time_out = 10;
var i = 0;
var timeout;
var opacity = 100;
function change_image() {
opacity--;
var j = i + 1;
var current_image = 'img_' + i;
if (i == image_count) j = 1;
var next_image = 'img_' + j;
document.getElementById(current_image).style.opacity=opacity/100;
document.getElementById(current_image).style.filter='alpha(opacity='+opacity+')';
document.getElementById(next_image).style.opacity=(100-opacity)/100;
document.getElementById(next_image).style.filter='alpha(opacity='+(100-opacity)+')';
timeout = setTimeout("change_image()", time_out);
if (opacity==1) {
opacity = 100;
clearTimeout(timeout);
}
}
setInterval (function() {i++; if (i>image_count) i=1; change_image();}, interval);
</script>
<img src='http://witosp.m98.ru/witosp.png' id="img_1" style="position: absolute;">
<img src='http://witosp.m98.ru/animakart/102.jpg' id="img_2" style="opacity: 0; filter: alpha(opacity=0);
position: absolute;">
<img src='http://witosp.m98.ru/animakart/anim_(7).gif' id="img_3" style="opacity: 0; filter: alpha(opacity=0);
position: absolute;"></script>