Skip to content

Instantly share code, notes, and snippets.

@DrewDouglass
Last active June 9, 2016 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DrewDouglass/0252d126dd1fe2a07c74ebf7134b5c91 to your computer and use it in GitHub Desktop.
Save DrewDouglass/0252d126dd1fe2a07c74ebf7134b5c91 to your computer and use it in GitHub Desktop.
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