Sha256: c06472d0541be1b745dcf33954c1473aa5fe50403b0a6e5a6a3672a5481e0d57
Contents?: true
Size: 915 Bytes
Versions: 29
Compression:
Stored size: 915 Bytes
Contents
I"‡(function() { var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; this.StickyElement = (function() { StickyElement.init = function(selector) { var $element; $element = $(selector); if (!$element.length) { return; } return new this($element); }; function StickyElement($element1) { this.$element = $element1; this.refresh = bind(this.refresh, this); this.staticElementTop = this.$element.position().top; this.refresh(); } StickyElement.prototype.refresh = function() { this.toggleStickyClass(); return window.requestAnimationFrame(this.refresh); }; StickyElement.prototype.toggleStickyClass = function() { return this.$element.toggleClass('sticky', window.pageYOffset >= this.staticElementTop); }; return StickyElement; })(); }).call(this); :ET
Version data entries
29 entries across 17 versions & 1 rubygems