/*! * version: 1.8.0 * date: 2016-07-09 * updates and docs at: http://greensock.com * * @license copyright (c) 2008-2016, 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 a=document.documentelement,b=window,c=function(c,d){var e="x"===d?"width":"height",f="scroll"+e,g="client"+e,h=document.body;return c===b||c===a||c===h?math.max(a[f],h[f])-(b["inner"+e]||a[g]||h[g]):c[f]-c["offset"+e]},d=function(a){return"string"==typeof a&&(a=tweenlite.selector(a)),a.length&&a!==b&&a[0]&&a[0].style&&!a.nodetype&&(a=a[0]),a===b||a.nodetype&&a.style?a:null},e=function(c,d){var e="scroll"+("x"===d?"left":"top");return c===b&&(null!=c.pagexoffset?e="page"+d.touppercase()+"offset":c=null!=a[e]?a:document.body),function(){return c[e]}},f=function(c,f){var g=d(c).getboundingclientrect(),h=!f||f===b||f===document.body,i=(h?a:f).getboundingclientrect(),j={x:g.left-i.left,y:g.top-i.top};return!h&&f&&(j.x+=e(f,"x")(),j.y+=e(f,"y")()),j},g=function(a,b,d){var e=typeof a;return"number"===e||"string"===e&&"="===a.charat(1)?a:"max"===a?c(b,d):math.min(c(b,d),f(a,b)[d])},h=_gsscope._gsdefine.plugin({propname:"scrollto",api:2,version:"1.8.0",init:function(a,c,d){return this._wdw=a===b,this._target=a,this._tween=d,"object"!=typeof c?(c={y:c},"string"==typeof c.y&&"max"!==c.y&&"="!==c.y.charat(1)&&(c.x=c.y)):c.nodetype&&(c={y:c,x:c}),this.vars=c,this._autokill=c.autokill!==!1,this.getx=e(a,"x"),this.gety=e(a,"y"),this.x=this.xprev=this.getx(),this.y=this.yprev=this.gety(),null!=c.x?(this._addtween(this,"x",this.x,g(c.x,a,"x")-(c.offsetx||0),"scrollto_x",!0),this._overwriteprops.push("scrollto_x")):this.skipx=!0,null!=c.y?(this._addtween(this,"y",this.y,g(c.y,a,"y")-(c.offsety||0),"scrollto_y",!0),this._overwriteprops.push("scrollto_y")):this.skipy=!0,!0},set:function(a){this._super.setratio.call(this,a);var d=this._wdw||!this.skipx?this.getx():this.xprev,e=this._wdw||!this.skipy?this.gety():this.yprev,f=e-this.yprev,g=d-this.xprev,i=h.autokillthreshold;this.x<0&&(this.x=0),this.y<0&&(this.y=0),this._autokill&&(!this.skipx&&(g>i||-i>g)&&di||-i>f)&&e