Skip to content

Commit

Permalink
Add project documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
skhilko committed Apr 7, 2015
1 parent 958cefe commit 26d1ea8
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,68 @@
# StickyHeaders
A JS library which enables sticky section headers in a scrollable list view.

## Browser Compatibility
- IE 10+
- Firefox 35+
- Chrome 36+
- Opera 27+

## API
StickyHeaders has a single instance option to pass during initialization.

### Instance Options
- `headerSelector` (string) _required_ - a selector targeting header elements within the list

## Usage
Using StickyHeaders is really simple. It has a pure JavaScript API, plus an optional jQuery plugin.

### Vanilla JS
Include the widget on the page.
```html
<!DOCTYPE html>
<html>
<head>
<script src="dist/scripts/stickyheaders.min.js"></script>
<link rel="stylesheet" href="dist/styles/stickyheaders.min.css">
</head>
</html>
```
Initialize the widget on the list element.
```javascript
var list = new StickyHeaders(document.getElementById('movies'), {
headerSelector: '.movies-genre'
});
```

### jQuery
Include the widget on the page.
```html
<!DOCTYPE html>
<html>
<head>
<script src="dist/scripts/stickyheaders.jquery.min.js"></script>
<link rel="stylesheet" href="dist/styles/stickyheaders.min.css">
</head>
</html>
```
Initialize the widget on the list element.
```javascript
$('movies').stickyHeaders({
headerSelector: '.movies-genre'
});
```

##Build
StickyHeaders uses `npm`, `bower` and `gulp`.

Initialize the dependencies:
```shell
npm install
bower install
```

Build the project:
```shell
gulp
```
The results will appear in the `dist` directory.

0 comments on commit 26d1ea8

Please sign in to comment.