Last active
June 9, 2016 18:45
-
-
Save DrewDouglass/0252d126dd1fe2a07c74ebf7134b5c91 to your computer and use it in GitHub Desktop.
Hide/show list of images with jQuery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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