Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Hide/show list of images with jQuery
//http://snook.ca/archives/javascript/simplest-jquery-slideshow
(function($){
$.fn.simplestSlideShow = function(settings){
var config = {
'timeOut': 3000,
'speed': 'normal'
};
if (settings) $.extend(config, settings);
this.each(function(){
var $elem = $(this);
$elem.children(':gt(0)').hide();
setInterval(function(){
$elem.children().eq(0).fadeOut(config['speed'])
.next().fadeIn(config['speed'])
.end().appendTo($elem);
}, config['timeOut']);
});
return this;
};
})(jQuery);
//$('.crazy-show-1').simplestSlideShow({'timeOut': 100, 'speed': 1000});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment