Skip to content

Commit

Permalink
Merge pull request #44 from loup-brun/direction
Browse files Browse the repository at this point in the history
Direction querying
  • Loading branch information
loup-brun authored Nov 21, 2016
2 parents 3ae9ef5 + 0fcc839 commit c66d0c1
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 108 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ Swipe can take an optional second parameter– an object of key/value settings:
- **autoRestart** Boolean *(default: `false`)*: auto restart slideshow after user's touch event or next/prev calls.
- **disableScroll** Boolean *(default: `false`)*: prevent any touch events on this container from scrolling the page.
- **stopPropagation** Boolean *(default: `false`)*: stop event propagation.
- **callback** Function *(default: `function() {}`)*: runs at slide change.
- **transitionEnd** Function *(default: `function() {}`)*: runs at the end of a slide transition.
- **callback** Function *(default: `function() {}`)*: runs at slide change. Three parameters are passed to the function: `index` (the current slide index), `elem` (the current slide element) and `dir` (direction: `1` for left or backward, `-1` for right or forward).
- **transitionEnd** Function *(default: `function() {}`)*: runs at the end of a slide transition. Two parameters are passed to the function: `index` (the current slide index) and `elem` (the current slide element).

### Example

Expand All @@ -101,7 +101,7 @@ window.mySwipe = new Swipe(document.getElementById('slider'), {
continuous: true,
disableScroll: false,
stopPropagation: false,
callback: function(index, elem) {},
callback: function(index, elem, dir) {},
transitionEnd: function(index, elem) {}
});
```
Expand Down
4 changes: 2 additions & 2 deletions build/swipe.min.js

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "swipejs",
"version": "2.1.5",
"version": "2.2.0",
"main": "swipe.js",
"description": "Swipe is the most accurate touch slider",
"author": "Brad Birdsall",
Expand Down
Loading

0 comments on commit c66d0c1

Please sign in to comment.