Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kanety/jquery-simple-iscroll


https://github.com/kanety/jquery-simple-iscroll

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# jquery-simple-iscroll

A jquery plugin for infinite scroll.

## Dependencies

* jquery

## Installation

Install from npm:

$ npm install @kanety/jquery-simple-iscroll --save

## Usage

Build html as follows:

```html





header
header




page1
page1





index.1.html
index.2.html
index.3.html



```

Then run:

```javascript
$('#container').simpleIscroll({
content: '#table tbody',
paging: '#paging',
next: 'a.next'
});
```

### Options

Show loading contents:

```javascript
$('#container').simpleIscroll({
...
loading: '.loading'
});
```

Set margin height to start loading before reaching at the bottom:

```javascript
$('#container').simpleIscroll({
...
margin: 10
});
```

### Callbacks

```javascript
$('#container').simpleIscroll({
...
}).on('load:start', function(e, href) {
...
}).on('load:end', function(e, href) {
...
}).on('load:success', function(e, $content, $paging) {
...
}).on('load:failure', function(e, nextHref, xhr, status, error) {
...
});
```

## License

The library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).