alexefish/ticker — Issue #2: List Ticker Speed
Author: welshandy
Created: 2012-02-02 11:29:02+00:00
State: open

Just testing your list ticker and I can't seem to slow the ticker speed down.

Here's the code I am using.

/* List Ticker by Alex Fish
// www.alexefish.com
//
// options:
//
// effect: fade/slide
// speed: milliseconds
*/

(function($){
$.fn.list_ticker = function(options){

var defaults = {
speed:8000,
effect:'fade'
};

var options = $.extend(defaults, options);

return this.each(function(){

var obj = $(this);
var list = obj.children();
list.not(':first').hide();

setInterval(function(){

list = obj.children();
list.not(':first').hide();

var first_li = list.eq(0)
var second_li = list.eq(1)

if(options.effect == 'slide'){
first_li.slideUp();
second_li.slideDown(function(){
first_li.remove().appendTo(obj);
});
} else if(options.effect == 'fade'){
first_li.fadeOut(function(){
second_li.fadeIn();
first_li.remove().appendTo(obj);
});
}
}, options.speed)
});
};
})(jQuery);