Skip to content

Commit

Permalink
Adding an option to set slidee element manually. Closes #195.
Browse files Browse the repository at this point in the history
  • Loading branch information
darsain committed Apr 28, 2015
1 parent e0574f8 commit 5aa26db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Sly call with all default options as defined in the source.

```js
var frame = new Sly('#frame', {
slidee: null, // Selector, DOM element, or jQuery object with DOM element representing SLIDEE.
horizontal: false, // Switch to horizontal mode.

// Item based navigation
Expand Down Expand Up @@ -94,6 +95,13 @@ var frame = new Sly('#frame', {

# Options

### slidee

Type: `String|Element|Object`
Default: `null`

This option allows to manually set what will Sly use as a SLIDEE element. By default, SLIDEE is a 1st child of FRAME.

### horizontal

Type: `Boolean`
Expand Down
3 changes: 2 additions & 1 deletion src/sly.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

// Frame
var $frame = $(frame);
var $slidee = $frame.children().eq(0);
var $slidee = o.slidee ? $(o.slidee).eq(0) : $frame.children().eq(0);
var frameSize = 0;
var slideeSize = 0;
var pos = {
Expand Down Expand Up @@ -2097,6 +2097,7 @@

// Default options
Sly.defaults = {
slidee: null, // Selector, DOM element, or jQuery object with DOM element representing SLIDEE.
horizontal: false, // Switch to horizontal mode.

// Item based navigation
Expand Down

0 comments on commit 5aa26db

Please sign in to comment.