scroll-syncer
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -0,1 +1,12 @@ | ||
// detect if user-agent support passive event binding | ||
var supportPassive = false | ||
if (window && window.addEventListener && Object.defineProperty) { | ||
var options = Object.defineProperty({}, 'passive', { | ||
get: function () { supportPassive = true } | ||
}) | ||
window.addEventListener('_detectpassive', null, options) | ||
} | ||
var bindOptions = supportPassive && { passive: true } | ||
function ScrollSyncer (vertical, horizontal) { | ||
@@ -14,3 +25,3 @@ this._els = [] | ||
if (!el || !el.addEventListener) return | ||
el.addEventListener('scroll', this._scrollHandler) | ||
el.addEventListener('scroll', this._scrollHandler, bindOptions) | ||
this._els.push(el) | ||
@@ -17,0 +28,0 @@ } |
{ | ||
"name": "scroll-syncer", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Synchronize scoll position among several elements", | ||
@@ -5,0 +5,0 @@ "main": "index.common.js", |
4734
37