[jQuery] take 3 values at time for fade in fade out effect.
Hello
I have following code which i am using for fade in fade out effect.
with this code at time only one image is coming. I want at time it
should show 3 images. like 1,2,3 then 4,5,6
Here is my code.
var index_news = 0;
//
function initNews() {
$('div#feed-ticker')
.slideDown('slow',
function() {
$('div#feed-ticker li').eq( index_news ).fadeIn();
setTimeout( next_news, 5000 );
}
);
}
function next_news() {
$('div#feed-ticker li')
.eq( index_news )
.fadeOut(1000,
function() {
index_news++;
if( index_news> $('div#feed-ticker li').length-1 )
index_news = 0;
$('div#feed-ticker li').eq( index_news ).fadeIn();
setTimeout( next_news, 5000 );
}
);
}
Can anyone tell me how can i set the value here. May be because of
this index_news++; its taking one value at time. but how can i
increase it by 3?
Thanks in advance.