UNPKG

es6tween-plugin-scroll

Version:

Scroll Plugin for es6-tween

1 lines 743 B
!function(e,t){"use strict";"function"==typeof define&&define.amd?define(["es6-tween"],function(e){return t(e)}):"undefined"!=typeof module&&module.exports&&require("es6-tween")?module.exports=t(require("es6-tween")):"undefined"!=typeof exports&&exports.TWEEN?t(exports.TWEEN):"undefined"!=typeof window&&window.TWEEN&&t(window.TWEEN)}(0,function(e){"use strict";var t=e.Plugins,n=e.Selector,o=function(e,t,o){return"string"==typeof e&&(e=n(e)),void 0!==e&&null!==e?e.nodeType?e.getBoundingClientRect()["scrollLeft"===t?"left":"top"]:e:o[t]};t.scrollTop=t.scrollLeft={init:function(e,t,n){var i=this.node;this.sv=o(e,n,i),this.ev=o(t,n,i)-this.s}},t.scrollTop.update=t.scrollLeft.update=function(e,t,n,o,i,s){this.node[s]=this.sv+this.ev*o}});