Skip to content

Commit

Permalink
Added option to stop gallery from animating.
Browse files Browse the repository at this point in the history
  • Loading branch information
akalicki committed Jul 14, 2013
1 parent a6556e4 commit 23beec1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ facility of code-reuse and fewer headaches. simple-gallery.js creates a
slideshow you can easily customize without having to worry about superfluous
code and unneeded options.

**CURRENT VERSION: v1.2.0**
**CURRENT VERSION: v1.3.0**

## Get Started ##

Expand Down Expand Up @@ -74,6 +74,10 @@ does not need to be an id, as long as the selector `$(target)` will only
select one appropriately sized DOM element from the page to cycle your images
through.

+ `animate` (optional, *default = true*) - a boolean true/false value
representing whether to animate the slideshow. If false, the target display
will only change images when you click on a thumbnail image.

+ `startImg` (optional, *default = 0*) - the zero-based index of the image to
start the slideshow at. A default value of 0 will tell the plugin to start at
the first image in the selection.
Expand Down
13 changes: 8 additions & 5 deletions simple-gallery.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* simple-gallery.js - v1.2.0
* simple-gallery.js - v1.3.0
* Author: Alex Kalicki (https://github.com/akalicki)
*
* simple-gallery.js is a lightweight jQuery extension for quickly creating
Expand Down Expand Up @@ -65,10 +65,12 @@
$(this).dequeue();
});
$.fn.gallery.endTransition();
$(options.target).queue(function() {
cycle = window.setTimeout(loadNext, options.waitTime);
$(this).dequeue();
});
if (options.animate) {
$(options.target).queue(function() {
cycle = window.setTimeout(loadNext, options.waitTime);
$(this).dequeue();
});
}
}

// load the next image in cycle
Expand Down Expand Up @@ -101,6 +103,7 @@
// create public defaults which can be overridden if requested
$.fn.gallery.defaults = {
target: "",
animate: true,
startImg: 0,
waitTime: 5000,
changeTime: 700,
Expand Down
6 changes: 4 additions & 2 deletions simple-gallery.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 23beec1

Please sign in to comment.