Skip to content

Commit

Permalink
Add polyfill override instructions and a few more caveats to the nati…
Browse files Browse the repository at this point in the history
…ve behavior.
  • Loading branch information
zachleat committed Oct 7, 2013
1 parent edc2786 commit f57986f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ Next, add the events and initialize your sticky nodes:

See [`demo.html`](http://filamentgroup.github.com/fixed-sticky/demo.html) for an example.

## Caveats
## Native `position: sticky` Caveats

Native `position: sticky` on iOS (and Chrome) does not support `position: sticky;` with `display: inline-block;`.
* iOS (and Chrome) do not support `position: sticky;` with `display: inline-block;`.
* `sticky` elements are constrained to the dimensions of their parents.
* This plugin (and Chrome’s implementation) does not (yet) support use with `thead` and `tfoot`.

### Using the polyfill instead of native

If you’re having weird issues with native `position: sticky`, you can tell fixed-sticky to use the polyfill instead of native. Just override the sticky feature test to always return false.

// After fixed-sticky.js
FixedSticky.tests.sticky = false;

## Installation

Expand Down
3 changes: 0 additions & 3 deletions fixedsticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@
init: function( el ) {
var $el = $( el );

// Ideally this should be added in markup.
$el.addClass( S.classes.plugin );

$( win ).bind( 'scroll', function() {
S.update( el );
}).trigger( 'scroll' );
Expand Down

0 comments on commit f57986f

Please sign in to comment.