Skip to content

Commit

Permalink
Add list of API methods in example usage section in README
Browse files Browse the repository at this point in the history
  • Loading branch information
David Cetinkaya committed Jun 16, 2019
1 parent ca9748f commit 12c0445
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,24 @@ Classname that will be applied to the wrapper when a pointer is dragging the car

## API

Embla exposes a set of methods upon setup that can be used to control the carousel externally. Example usage looks like this...
Embla exposes a set of methods upon setup that can be used to control the carousel externally. Usage looks like this:

```javascript
embla.containerNode()
embla.slideNodes()
embla.next()
embla.previous()
embla.goTo(2)
embla.selectedIndex()
embla.previousIndex()
embla.groupedIndexes()
embla.isFirstIndex()
embla.islastIndex()
embla.hasPreviousIndex()
embla.hasNextIndex()
embla.changeOptions({ loop: true })
embla.on('select', () => console.log('Selected a new index!'))
embla.destroy()
```

...and the methods are:
Expand Down

0 comments on commit 12c0445

Please sign in to comment.