Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

PositionSticky

Code Climate Build Status

Usage

 -------------------------- => window 
|   --------------------   |
|  |              ---   |==|=> container
|  |             |   |  |  |
|  |             |   |==|==|=> sticky  
|  |              ---   |  |
|  |                    |  |
|  |                    |  |
|  |                    |  |
|  |                    |  |
|   --------------------   |
|   --------------------   |
|  |                    |  |
|  |                    |  |

PositionSticky follows UMD pattern.

###Consume as a CommonJS module

var PositionSticky = require('./bower_components/PositionSticky/dist/PositionSticky.js');
var element = document.getElementById('sticky');
var sticky  = PositionSticky.create(element);  

###Consume as an AMD module

require(['./bower_components/PositionSticky/dist/PositionSticky.js'], function(PositionSticky) {
  var element = document.getElementById('sticky');
  var sticky  = PositionSticky.create(element);
});  

###Consume as a global variable

var element = document.getElementById('sticky');
var sticky  = PositionSticky.create(element);  

Examples

Browser Support

  • Chrome
  • Firefox
  • Safari
  • IE9+