Skip to content

Commit

Permalink
Update README, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
bchanx committed Nov 21, 2013
1 parent 5b4c1f3 commit 7e51b27
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 45 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,19 @@ Tested on Chrome 26.0, Firefox 20.0, Safari 5.1.7, IE 10, Opera 16.0. Limited su

[Check out the demo here.](http://www.bchanx.com/slidr)

## Features
- **Add as many Slidr's as you want** - *even place them within each other.*
- **Dynamic resizing** - *adapts to the size of its content, unless you don't want it to.*
- **Keyboard navigation** - *move your cursor on top of a Slidr, and hit the arrow keys!*
- **Touch navigation** (mobile) - *change slides by swiping left, right, up or down!*

## Instructions
Include either `slidr.js` or `slidr.min.js` somewhere at the bottom of your html page, after the body content.

```javascript
<script type="text/javascript" src="/path/to/slidr.min.js"></script>
```

--------
## HTML
slidr.js works on any `inline`, `inline-block` or `block` elements with an `id` defined.
Valid slides include any first-level children elements with the `data-slidr` attribute set to some unique value within the parent scope. For example:
Expand Down Expand Up @@ -42,25 +47,26 @@ Valid slides include any first-level children elements with the `data-slidr` att
are all valid html markup for creating three different `Slidr`'s within the same page.
(inline elements are transformed into inline-blocks in order to apply transitions).

------------
## Javascript
A global `slidr` object is available for calling. The most minimal way of creating a slidr is this:

```javascript
slidr.create('slidr-ul').start();
slidr.create('slidr-id').start();
```

`create()` accepts an optional settings parameter as its second argument. A call with all the settings toggled looks like so:

```javascript
slidr.create('slidr-ul', {
slidr.create('slidr-id', {
breadcrumbs: true,
controls: 'corner',
direction: 'vertical',
fade: false,
keyboard: true,
overflow: true,
theme: '#222',
timing: { 'cube': '0.5s ease-in' },
touch: true,
transition: 'cube'
}).start();
```
Expand All @@ -74,9 +80,11 @@ Full details on available settings listed below:
| `controls` | _string_ | border | Show or hide control arrows on start(). `border`, `corner` or `none`. |
| `direction` | _string_ | horizontal | The default direction for new slides. `horizontal` or `h`, `vertical` or `v`. |
| `fade` | _bool_ | true | Whether slide transitions should fade in/out. `true` or `false`. |
| `keyboard` | _bool_ | false | Whether to enable keyboard navigation upon mouseover. `true` or `false`. |
| `overflow` | _bool_ | false | Whether to overflow transitions at slidr borders. `true` or `false`. |
| `theme` | _string_ | #fff | Sets color theme for breadcrumbs/controls. `#hexcode` or `rgba(value)`. |
| `timing` | _object_ | {} | Custom animation timings to apply. `{'transition': 'timing'}`. |
| `touch` | _bool_ | false | Whether to enable touch navigation for mobile devices. `true` or `false`. |
| `transition` | _string_ | linear | The default transition to apply. `cube`, `linear`, `fade`, or `none`. |

### Global API
Expand Down Expand Up @@ -209,7 +217,6 @@ The full list of available functions in a `Slidr` object is listed below:
function controls(opt_scheme) {};
```

------------
## CSS

### Temporary scrollbar during transitions
Expand All @@ -222,7 +229,7 @@ body {
}
```

### Auto resize
### Dynamic resize
`Slidr` follows a fairly straightforward heuristic for figuring out what it's width or height should be. If the `width`
and `height` is explicitly set, `Slidr` will not resize. Otherwise, it will always adapt to the size of its content.
You can also set just one and it'll dynamic resize the other.
Expand Down Expand Up @@ -345,7 +352,6 @@ In the worst case, feel free to create your own controllers and access via the S

For further questions or issues, visit [here](https://github.com/bchanx/slidr/issues).

------------
## License

This software is free to use under the MIT license.
6 changes: 3 additions & 3 deletions slidr.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* slidr v0.2.0 - A Javascript library for adding slide effects.
* slidr v0.3.0 - A Javascript library for adding slide effects.
* bchanx.com/slidr
* MIT licensed
*
Expand Down Expand Up @@ -1258,7 +1258,7 @@
})(), 250);

// Current version.
var VERSION = '0.2.0';
var VERSION = '0.3.0';

// Active Slidr instances.
var INSTANCES = {};
Expand All @@ -1273,7 +1273,7 @@
'overflow': false, // Whether to overflow transitions at slidr borders. `true` or `false`.
'theme': '#fff', // Sets color theme for breadcrumbs/controls. #hexcode or rgba(value).
'timing': {}, // Custom animation timings to apply. {'transition': 'timing'}.
'touch': false, // Whether to enable touch naviation for mobile devices. `true` or `false`.
'touch': false, // Whether to enable touch navigation for mobile devices. `true` or `false`.
'transition': 'linear' // The default transition to apply. `cube`, `linear`, `fade`, or `none`.
};

Expand Down
Loading

0 comments on commit 7e51b27

Please sign in to comment.