I'm having some trouble getting my head around the jquery queue method. I've got the following code, and basically want the four parts of function textScroll to execute one after the other. Any help would be really appreciated.
$.fn.pause = function (n) {
return this.queue(function () {
var el = this;
setTimeout(function () {
return $(el).dequeue();
}, n);
});
};
function textScroll(){
$('#winner1, #winner2').css("display", "block")
.pause(4000)
.animate({left: '-1000px'}, 2000);
$('#winner3, #winner4').fadeIn()
.pause(4000)
.animate({left: '-1000px'}, 2000);
$('#winner5, #winner6').fadeIn()
.pause(4000)
.animate({left: '-1000px'}, 2000);
$('.winner_scroll').css("display", "none")
.pause(1000)
.css("left", "1000px");
}
delay()method; it does this for you, but you'll have to use thequeue()method to queue thecss()call, as that doesn't use thefxqueue by default..css?