/*! * VERSION: 1.9.0 * DATE: 2018-02-15 * UPDATES AND DOCS AT: http://greensock.com * * @license Copyright (c) 2008-2018, GreenSock. All rights reserved. * This work is subject to the terms at http://greensock.com/standard-license or for * Club GreenSock members, the software agreement that was issued with your membership. * * @author: Jack Doyle, jack@greensock.com **/ var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";var t=(_gsScope.document||{}).documentElement,e=_gsScope,s=function(s,i){var o="x"===i?"Width":"Height",l="scroll"+o,n="client"+o,r=document.body;return s===e||s===t||s===r?Math.max(t[l],r[l])-(e["inner"+o]||t[n]||r[n]):s[l]-s["offset"+o]},i=function(t){return"string"==typeof t&&(t=TweenLite.selector(t)),t.length&&t!==e&&t[0]&&t[0].style&&!t.nodeType&&(t=t[0]),t===e||t.nodeType&&t.style?t:null},o=function(s,i){var o="scroll"+("x"===i?"Left":"Top");return s===e&&(null!=s.pageXOffset?o="page"+i.toUpperCase()+"Offset":s=null!=t[o]?t:document.body),function(){return s[o]}},l=function(s,l){var n=i(s).getBoundingClientRect(),r=!l||l===e||l===document.body,h=(r?t:l).getBoundingClientRect(),u={x:n.left-h.left,y:n.top-h.top};return!r&&l&&(u.x+=o(l,"x")(),u.y+=o(l,"y")()),u},n=function(t,e,i){var o=typeof t;return isNaN(t)?"number"===o||"string"===o&&"="===t.charAt(1)?t:"max"===t?s(e,i):Math.min(s(e,i),l(t,e)[i]):parseFloat(t)},r=_gsScope._gsDefine.plugin({propName:"scrollTo",API:2,global:!0,version:"1.9.0",init:function(t,s,i){return this._wdw=t===e,this._target=t,this._tween=i,"object"!=typeof s?(s={y:s},"string"==typeof s.y&&"max"!==s.y&&"="!==s.y.charAt(1)&&(s.x=s.y)):s.nodeType&&(s={y:s,x:s}),this.vars=s,this._autoKill=!1!==s.autoKill,this.getX=o(t,"x"),this.getY=o(t,"y"),this.x=this.xPrev=this.getX(),this.y=this.yPrev=this.getY(),null!=s.x?(this._addTween(this,"x",this.x,n(s.x,t,"x")-(s.offsetX||0),"scrollTo_x",!0),this._overwriteProps.push("scrollTo_x")):this.skipX=!0,null!=s.y?(this._addTween(this,"y",this.y,n(s.y,t,"y")-(s.offsetY||0),"scrollTo_y",!0),this._overwriteProps.push("scrollTo_y")):this.skipY=!0,!0},set:function(t){this._super.setRatio.call(this,t);var i=this._wdw||!this.skipX?this.getX():this.xPrev,o=this._wdw||!this.skipY?this.getY():this.yPrev,l=o-this.yPrev,n=i-this.xPrev,h=r.autoKillThreshold;this.x<0&&(this.x=0),this.y<0&&(this.y=0),this._autoKill&&(!this.skipX&&(n>h||-h>n)&&ih||-h>l)&&o