Different delay for multiple nivo slider on same page
I found Nivo slider pretty promising and I have implemented it in several of my new projects. However, now, I would like to have multiple (2 to 3) sliders on the same page. This is possible. But I want each of them start after a certain delay with respect to last one. Example, first one loads on page load, second one, 1 second after that and so on. I referred to the community support and found this article. http://dev7studios.com/support/#/discussion/212 However, even this does not开发者_运维技巧 solve it. Please help me with the same. Thanks a lot.
$('#slider1').nivoSlider()
.delay(1000)
.queue(function(){
$('#slider2').nivoSlider()
.delay(1000)
.queue(function(){
$('#slider3').nivoSlider();
});
});
http://jsfiddle.net/LfkkF/17/
I couldn't get the above answer to work so i implemented a javascript delay like so:
$(window).load(function() {
setTimeout(function() {$('#slider3').nivoSlider({
directionNav : false,
controlNav: false,
});},250);
});
With the number (250) being the delay in miliseconds. I only wanted a very short delay so this method worked for me, but the image displays a loading-icon for the duration of the delay, so anything longer than .5 sec would look ugly I guess.
Here's where I found the method. http://www.sean.co.uk/a/webdesign/javascriptdelay.shtm
精彩评论