ianli/jquery-infinite-drag — pull request #13 by Sleavely (2014-02-15 12:04:53+00:00)
Title: Bits and pieces from years of forking

First off, I would've cried myself to sleep for quite a long time if I hadn't found this plugin, so thanks. :)

### Highlights

- Ability to remove tiles that are outside of the viewport (*kind of* addresses #12)
- Optional support for [jquery.pep.js](http://pep.briangonzalez.org/) which uses CSS3 for moving the grid. This results in major performance boosts, especially when you have large (1000x1000) grids that you want to move across the screen.
- Optional callback with grouping of all the tiles that were created in the last couple of milliseconds.
```js
jQuery.infinitedrag(
'#canvas',
{},
{
// ... your tile options go here. Then add:

aggregate_time: 100,
on_aggregate: function(agg_data){
// agg_data is an array that contains objects like this {tile:$new_tile, x:1024, y:202}
// where $new_tile is the jQuery object of the tile that was created.
}
}
);
```
- Optionally pre-create a perimeter around the viewport:
```js
jQuery.infinitedrag(
'#canvas',
{},
{
// ... your tile options go here. Then add:

// This will create 10 tiles in each direction around the viewport.
// This comes in very handy when creating tiles is an expensive operation and you want smooth scrolling.
margin: 10
}
);
```