mkoryak/floatThead — pull request #113 by ritchieking (2014-09-20 00:55:05+00:00)
Title: add iframe option

Was just using this to try to fix a header on a table inside of an iframe with no overflow — but the iframe didn't recognize when I scrolled. Added this `iframe` option, which sets `$window` to `$(window.parent)` so that scroll events are detected.

The way to use this feature like a pro is to set the `scrollingTop` function so that the header gets fixed at the top of the window:

```
var $table = $('#table-id');
$table.floatThead({
scrollingTop: function($table) {
try {
return -$(window.parent.document).find('#table-id').offset().top;
}
catch(e) {
return 0;
}
}
});
```

The reason for the try/catch is so you can build and test the table without having to put it inside an iframe — in other words, `window.parent.document` doesn't have to exist, but if it does, it will be used as a reference point.