[
  {
    "path": ".gitignore",
    "content": ".DS_Store\n._*\nnode_modules\ndist"
  },
  {
    "path": ".nodemonignore",
    "content": "/build/*\n/dist/*\n/demos/*\n*.md\n*.tmp"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to iScroll / FAQ\n\nYou are very welcome to collaborate, all changes to the code will be released under an MIT license.\n\nBy submitting a pull request you implicitly agree to give rights of your code to the project authors. Your contribution will always be released under the same MIT license.\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright (c) 2008-2013 Matteo Spinelli, http://cubiq.org\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE."
  },
  {
    "path": "README.md",
    "content": "<h1 id=\"intro\">iScroll, smooth scrolling for the web</h1>\n\niScroll is a high performance, small footprint, dependency free, multi-platform javascript scroller.\n\nIt works on desktop, mobile and smart TV. It has been vigorously optimized for performance and size so to offer the smoothest result on modern and old devices alike.\n\niScroll does not just *scroll*. It can handle any element that needs to be moved with user interaction. It adds scrolling, zooming, panning, infinite scrolling, parallax scrolling, carousels to your projects and manages to do that in just 4kb. Give it a broom and it will also clean up your office.\n\nEven on platforms where native scrolling is good enough, iScroll adds features that wouldn't be possible otherwise. Specifically:\n\n* Granular control over the scroll position, even during momentum. You can always get and set the x,y coordinates of the scroller.\n* Animation can be customized with user defined easing functions (bounce, elastic, back, ...).\n* You can easily hook to a plethora of custom events (onBeforeScrollStart, onScrollStart, onScroll, onScrollEnd, flick, ...).\n* Out of the box multi-platform support. From older Android devices to the latest iPhone, from Chrome to Internet Explorer.\n\n<h2 id=\"iscroll-versions\">The many faces of iScroll</h2>\n\niScroll is all about optimization. To reach the highest performance it has been divided into multiple versions. You can pick the version that better suits your need.\n\nCurrently we have the following fragrances:\n\n* **iscroll.js**, it is the general purpose script. It includes the most commonly used features and grants very high performance in a small footprint.\n* **iscroll-lite.js**, it is a stripped down version of the main script. It doesn't support snap, scrollbars, mouse wheel, key bindings. But if all you need is scrolling (especially on mobile) *iScroll lite* is the smallest, fastest solution.\n* **iscroll-probe.js**, probing the current scroll position is a demanding task, that's why I decided to build a dedicated version for it. If you need to know the scrolling position at any given time, this is the iScroll for you. (I'm making some more tests, this might end up in the regular `iscroll.js` script, so keep an eye on it).\n* **iscroll-zoom.js**, adds zooming to the standard scroll.\n* **iscroll-infinite.js**, can do infinite and cached scrolling. Handling very long lists of elements is no easy task for mobile devices. *iScroll infinite* uses a caching mechanism that lets you scroll a potentially infinite number of elements.\n\n<h2 id=\"getting-started\">Getting started</h2>\n\nSo you want to be an iScroll master. Cool, because that is what I'll make you into.\n\nThe best way to learn the iScroll is by looking at the demos. In the archive you'll find a `demo` folder [stuffed with examples](https://github.com/cubiq/iscroll/tree/master/demos). Most of the script features are outlined there.\n\n`IScroll` is a class that needs to be initiated for each scrolling area. There's no limit to the number of iScrolls you can have in each page if not that imposed by the device CPU/Memory.\n\nTry to keep the DOM as simple as possible. iScroll uses the hardware compositing layer but there's a limit to the elements the hardware can handle.\n\nThe optimal HTML structure is:\n\n```html\n<div id=\"wrapper\">\n    <ul>\n        <li>...</li>\n        <li>...</li>\n        ...\n    </ul>\n</div>\n```\n\niScroll must be applied to the wrapper of the scrolling area. In the above example the `UL` element will be scrolled. Only the first child of the container element is scrolled, additional children are simply ignored.\n\n<div class=\"tip\">\n<p><code>box-shadow</code>, <code>opacity</code>, <code>text-shadow</code> and alpha channels are all properties that don't go very well together with hardware acceleration. Scrolling might look good with few elements but as soon as your DOM becomes more complex you'll start experiencing lag and jerkiness.</p>\n\n<p>Sometimes a background image to simulate the shadow performs better than <code>box-shadow</code>. The bottom line is: experiment with CSS properties, you'll be surprised by the difference in performance a small CSS change can do.</p>\n</div>\n\nThe minimal call to initiate the script is as follow:\n\n```html\n<script type=\"text/javascript\">\nvar myScroll = new IScroll('#wrapper');\n</script>\n```\n\nThe first parameter can be a string representing the DOM selector of the scroll container element OR a reference to the element itself. The following is a valid syntax too:\n\n```js\nvar wrapper = document.getElementById('wrapper');\nvar myScroll = new IScroll(wrapper);\n```\n\nSo basically either you pass the element directly or a string that will be given to `querySelector`. Consequently to select a wrapper by its class name instead of the ID, you'd do:\n\n```js\nvar myScroll = new IScroll('.wrapper');\n```\n\nNote that iScroll uses `querySelector` not `querySelectorAll`, so only the first occurrence of the selector is used. If you need to apply iScroll to multiple objects you'll have to build your own cycle.\n\n<div class=\"tip\">\n<p>You don't strictly need to assign the instance to a variable (<code>myScroll</code>), but it is handy to keep a reference to the iScroll.</p>\n\n<p>For example you could later check the <a href=\"#scroller-info\">scroller position</a> or <a href=\"#destroy\">unload unnecessary events</a> when you don't need the iScroll anymore.</p>\n</div>\n\n<h2 id=\"initialization\">Initialization</h2>\n\nThe iScroll needs to be initiated when the DOM is ready. The safest bet is to start it on window `onload` event. `DOMContentLoaded` or inline initialization are also fine but remember that the script needs to know the height/width of the scrolling area. If you have images that don't have explicit width/height declaration, iScroll will most likely end up with a wrong scroller size.\n\n<div class=\"important\">\n<p>Add <code>position:relative</code> or <code>absolute</code> to the scroll container (the wrapper). That alone usually solves most of the problems with wrongly calculated wrapper dimensions.</p>\n</div>\n\nTo sum up, the smallest iScroll configuration is:\n\n```html\n<head>\n...\n<script type=\"text/javascript\" src=\"iscroll.js\"></script>\n<script type=\"text/javascript\">\nvar myScroll;\nfunction loaded() {\n    myScroll = new IScroll('#wrapper');\n}\n</script>\n</head>\n...\n<body onload=\"loaded()\">\n<div id=\"wrapper\">\n    <ul>\n        <li>...</li>\n        <li>...</li>\n        ...\n    </ul>\n</div>\n</body>\n```\n\nRefer to the [barebone example](http://lab.cubiq.org/iscroll5/demos/barebone/) for more details on the minimal CSS/HTML requirements.\n\n<div class=\"tip\">\n<p>If you have a complex DOM it is sometimes smart to add a little delay from the <code>onload</code> event to iScroll initialization. Executing the iScroll with a 100 or 200 milliseconds delay gives the browser that little rest that can save your ass.</p>\n</div>\n\n<h2 id=\"configuring\">Configuring the iScroll</h2>\n\niScroll can be configured by passing a second parameter during the initialization phase.\n\n```js\nvar myScroll = new IScroll('#wrapper', {\n    mouseWheel: true,\n    scrollbars: true\n});\n```\n\nThe example above turns on mouse wheel support and scrollbars.\n\nAfter initialization you can access the *normalized* values from the `options` object. Eg:\n\n```js\nconsole.dir(myScroll.options);\n```\n\nThe above will return the configuration the `myScroll` instance will run on. By *normalized* I mean that if you set `useTransform:true` (for example) but the browser doesn't support CSS transforms, `useTransform` will be `false`.\n\n<h2 id=\"the-core\">Understanding the core</h2>\n\niScroll uses various techniques to scroll based on device/browser capability. **Normally you don't need to configure the engine**, iScroll is smart enough to pick the best for you.\n\nNonetheless it is important to understand which mechanisms iScroll works on and how to configure them.\n\n### <small>options.</small>useTransform\n\nBy default the engine uses the `transform` CSS property. Setting this to `false` scrolls like we were in 2007, ie: using the `top`/`left` (and thus the scroller needs to be absolutely positioned).\n\nThis might be useful when scrolling sensitive content such as Flash, iframes and videos, but be warned: performance loss is huge.\n\nDefault: `true`\n\n### <small>options.</small>useTransition\n\niScroll uses CSS transition to perform animations (momentum and bounce). By setting this to `false`, `requestAnimationFrame` is used instead.\n\nOn modern browsers the difference is barely noticeable. On older devices transitions perform better.\n\nDefault: `true`\n\n### <small>options.</small>HWCompositing\n\nThis option tries to put the scroller on the hardware layer by appending `translateZ(0)` to the transform CSS property. This greatly increases performance especially on mobile, but there are situations where you might want to disable it (notably if you have too many elements and the hardware can't catch up).\n\nDefault: `true`\n\n<div class=\"important\">\n<p>If unsure leave iScroll decide what's the optimal config. For best performance all the above options should be set to <code>true</code> (or better leave them undefined as they are set to true automatically). You may try to play with them in case you encounter hiccups and memory leaks.</p>\n</div>\n\n<h2 id=\"basic-features\">Basic features</h2>\n\n### <small>options.</small>bounce\n\nWhen the scroller meets the boundary it performs a small bounce animation. Disabling bounce may help reach smoother results on old or slow devices.\n\nDefault: `true`\n\n### <small>options.</small>click\n\nTo override the native scrolling iScroll has to inhibit some default browser behaviors, such as mouse clicks. If you want your application to respond to the *click* event you have to explicitly set this option to `true`. Please note that it is suggested to use the custom `tap` event instead (see below).\n\nDefault: `false`\n\n### <small>options.</small>disableMouse<br/><small>options.</small>disablePointer<br/><small>options.</small>disableTouch\n\nBy default iScroll listens to all pointer events and reacts to the first one that occurs. It may seem a waste of resources but feature detection has proven quite unreliable and this *listen-to-all* approach is our safest bet for wide browser/device compatibility.\n\nIf you have an internal mechanism for device detection or you know in advance where your script will run on, you may want to disable all event sets you don't need (mouse, pointer or touch events).\n\nFor example to disable mouse and pointer events:\n\n```js\nvar myScroll = new IScroll('#wrapper', {\n    disableMouse: true,\n    disablePointer: true\n});\n```\n\nDefault: `false`\n\n### <small>options.</small>eventPassthrough\n\nSometimes you want to preserve native vertical scroll but being able to add an horizontal iScroll (maybe a carousel). Set this to `true` and the iScroll area will react to horizontal swipes only. Vertical swipes will naturally scroll the whole page.\n\nSee [event passthrough demo](http://lab.cubiq.org/iscroll5/demos/event-passthrough/) on a mobile device. Note that this can be set to `'horizontal'` to inverse the behavior (native horizontal scroll, vertical iScroll).\n\n### <small>options.</small>freeScroll\n\nThis is useful mainly on 2D scrollers (when you need to scroll both horizontally and vertically). Normally when you start scrolling in one direction the other is locked.\n\nSometimes you just want to move freely with no constrains. In these cases you can set this option to `true`. See [2D scroll demo](http://lab.cubiq.org/iscroll5/demos/2d-scroll/).\n\nDefault: `false`\n\n### <small>options.</small>keyBindings\n\nSet this to `true` to activate keyboard (and remote controls) interaction. See the [Key bindings](#key-bindings) section below for more information.\n\nDefault: `false`\n\n### <small>options.</small>invertWheelDirection\n\nMeaningful when mouse wheel support is activated, in which case it just inverts the scrolling direction. (ie. going down scrolls up and vice-versa).\n\nDefault: `false`\n\n### <small>options.</small>momentum\n\nYou can turn on/off the momentum animation performed when the user quickly flicks on screen. Turning this off greatly enhances performance.\n\nDefault: `true`\n\n### <small>options.</small>mouseWheel\n\nListen to the mouse wheel event.\n\nDefault: `false`\n\n### <small>options.</small>preventDefault\n\nWhether or not to `preventDefault()` when events are fired. This should be left `true` unless you really know what you are doing.\n\nSee `preventDefaultException` in the [Advanced options](#advanced-options) for more control over the preventDefault behavior.\n\nDefault: `true`\n\n### <small>options.</small>scrollbars\n\nWheter or not to display the default scrollbars. See more in the [Scrollbar](#scrollbar) section.\n\nDefault: `false`.\n\n### <small>options.</small>scrollX<br/><small>options.</small>scrollY\n\nBy default only vertical scrolling is enabled. If you need to scroll horizontally you have to set `scrollX` to `true`. See [horizontal demo](http://lab.cubiq.org/iscroll5/demos/horizontal/).\n\nSee also the **freeScroll** option.\n\nDefault: `scrollX: false`, `scrollY: true`\n\n<div class=\"important\">\n<p>Note that <code>scrollX/Y: true</code> has the same effect as <code>overflow: auto</code>. Setting one direction to <code>false</code> helps to spare some checks and thus CPU cycles.</p>\n</div>\n\n### <small>options.</small>startX<br/><small>options.</small>startY\n\nBy default iScroll starts at `0, 0` (top left) position, you can instruct the scroller to kickoff at a different location.\n\nDefault: `0`\n\n### <small>options.</small>tap\n\nSet this to `true` to let iScroll emit a custom `tap` event when the scroll area is clicked/tapped but not scrolled.\n\nThis is the suggested way to handle user interaction with clickable elements. To listen to the tap event you would add an event listener as you would do for a standard event. Example: \n\n```js\nelement.addEventListener('tap', doSomething, false); \\\\ Native\n$('#element').on('tap', doSomething); \\\\ jQuery\n```\n    \nYou can also customize the event name by passing a string. Eg:\n\n```js\ntap: 'myCustomTapEvent'\n```\n\nIn this case you'd listen to `myCustomTapEvent`.\n\nDefault: `false`\n\n<h2 id=\"scrollbars\">Scrollbars</h2>\n\nThe scrollbars are more than just what the name suggests. In fact internally they are referenced as *indicators*.\n\nAn indicator listens to the scroller position and normally it just shows its position in relation to whole, but what it can do is so much more.\n\nLet's start with the basis.\n\n### <small>options.</small>scrollbars\n\nAs we mentioned in the [Basic features section](#basic-features) there's only one thing that you got to do to activate the scrollbars in all their splendor, and that one thing is:\n\n```js\nvar myScroll = new IScroll('#wrapper', {\n    scrollbars: true\n});\n```\n\nOf course the default behavior can be personalized.\n\n### <small>options.</small>fadeScrollbars\n\nWhen not in use the scrollbar fades away. Leave this to `false` to spare resources.\n\nDefault: `false`\n\n### <small>options.</small>interactiveScrollbars\n\nThe scrollbar becomes draggable and user can interact with it.\n\nDefault: `false`\n\n### <small>options.</small>resizeScrollbars\n\nThe scrollbar size changes based on the proportion between the wrapper and the scroller width/height. Setting this to `false` makes the scrollbar a fixed size. This might be useful in case of custom styled scrollbars ([see below](#styling-the-scrollbar)).\n\nDefault: `true`\n\n### <small>options.</small>shrinkScrollbars\n\nWhen scrolling outside of the boundaries the scrollbar is shrunk by a small amount.\n\nValid values are: `'clip'` and `'scale'`.\n\n`'clip'` just moves the indicator outside of its container, the impression is that the scrollbar shrinks but it is simply moving out of the screen. If you can live with the visual effect this option **immensely improves overall performance**.\n\n`'scale'` turns off `useTransition` hence all animations are served with `requestAnimationFrame`. The indicator is actually varied in size and the end result is nicer to the eye.\n\nDefault: `false`\n\n<div class=\"tip\">\n<p>Note that resizing can't be performed by the GPU, so <code>scale</code> is all on the CPU.</p>\n<p>If your application runs on multiple devices my suggestion would be to switch this option to <code>'scale'</code>, <code>'clip'</code> or <code>false</code> based on the platform responsiveness (eg: on older mobile devices you could set this to <code>'clip'</code> and on desktop browser to <code>'scale'</code>).</p>\n</div>\n\nSee the [scrollbar demo](http://lab.cubiq.org/iscroll5/demos/scrollbars/).\n\n<h3 id=\"styling-the-scrollbar\">Styling the scrollbar</h3>\n\nSo you don't like the default scrollbar styling and you think you could do better. Help yourself! iScroll makes dressing the scrollbar a snap. First of all set the `scrollbars` option to `'custom'`:\n\n```js\nvar myScroll = new IScroll('#wrapper', {\n    scrollbars: 'custom'\n});\n```\n\nThen use the following CSS classes to style the little bastards.\n\n* **.iScrollHorizontalScrollbar**, this is applied to the horizontal container. The element that actually hosts the scrollbar indicator.\n* **.iScrollVerticalScrollbar**, same as above but for the vertical container.\n* **.iScrollIndicator**, the actual scrollbar indicator.\n* **.iScrollBothScrollbars**, this is added to the container elements when both scrollbars are shown. Normally just one (horizontal or vertical) is visible.\n\nThe [styled scrollbars demo](http://lab.cubiq.org/iscroll5/demos/styled-scrollbars/) should make things clearer than my lousy explanation.\n\nIf you set `resizeScrollbars: false` you could make the scrollbar of a fixed size, otherwise it would be resized based on the scroller length.\n\nPlease keep reading to the following section for a revelation that will shake your world.\n\n<h2 id=\"indicators\">Indicators</h2>\n\nAll the scrollbar options above are in reality just wrappers to the low level `indicators` option. It looks more or less like this:\n\n```js\nvar myScroll = new IScroll('#wrapper', {\n    indicators: {\n        el: [element|element selector]\n        fade: false,\n        ignoreBoundaries: false,\n        interactive: false,\n        listenX: true,\n        listenY: true,\n        resize: true,\n        shrink: false,\n        speedRatioX: 0,\n        speedRatioY: 0,\n    }\n});\n```\n\n### <small>options.indicators.</small>el\n\nThis is a mandatory parameter which holds a reference to the scrollbar container element. The first child inside the container will be the indicator. Note that the scrollbar can be anywhere on your document, it doesn't need to be inside the scroller wrapper. Do you start perceiving the power of such tool?\n\nValid syntax would be:\n\n```js\nindicators: {\n    el: document.getElementById('indicator')\n}\n```\n\nOr simply:\n\n```js\nindicators: {\n    el: '#indicator'\n}\n```\n\n### <small>options.indicators.</small>ignoreBoundaries\n\nThis tells the indicator to ignore the boundaries imposed by its container. Since we can alter the speed ratio of the scrollbar, it is useful to just let the scrollbar go. Say you want the indicator to go twice as fast as the scroller, it would reach the end of its run very quickly. This option is used for [parallax scrolling](#parallax-scrolling).\n\nDefault: `false`\n\n### <small>options.indicators.</small>listenX<br/><small>options.indicators.</small>listenY\n\nTo which axis the indicator listens to. It can be just one or both.\n\nDefault: `true`\n\n### <small>options.indicators.</small>speedRatioX<br/><small>options.indicators.</small>speedRatioY\n\nThe speed the indicator moves in relation to the main scroller size. By default this is set automatically. You rarely need to alter this value.\n\nDefault: `0`\n\n### <small>options.indicators.</small>fade<br/><small>options.indicators.</small>interactive<br/><small>options.indicators.</small>resize</br><small>options.indicators.</small>shrink\n\nThese are the same options we explored in the [scrollbars section](#scrollbars), I'm not going to insult your intelligence and repeat them here.\n\n<div class=\"important\">\n<p><strong>Do not cross the streams. It would be bad!</strong> Do not mix the scrollbars syntax (<code>options.scrollbars</code>, <code>options.fadeScrollbars</code>, <code>options.interactiveScrollbars</code>, ...) with the indicators! Use one or the other.</p>\n</div>\n\nHave a look at the [minimap demo](http://lab.cubiq.org/iscroll5/demos/minimap/) to get a glance at the power of the `indicators` option.\n\nThe wittiest of you would have noticed that `indicators` is actually plural... Yes, exactly, passing an array of objects you can have a virtually infinite number of indicators. I don't know what you may need them for, but hey! who am I to argue about your scrollbar preferences?\n\n## <span id=\"parallax-scrolling\">Parallax scrolling</span>\n\nParallax scrolling is just a *collateral damage* of the [Indicators](#indicators) functionality.\n\nAn indicator is just a layer that follows the movement and animation applied to the main scroller. If you see it like that you'll understand the power behind this feature. To this add that you can have any number of indicators and the parallax scrolling is served.\n\nPlease refer to the [parallax demo](http://lab.cubiq.org/iscroll5/demos/parallax/).\n\n## Scrolling programmatically\n\nYou silly! Of course you can scroll programmaticaly!\n\n### scrollTo(x, y, time, easing)\n\nSay your iScroll instance resides into the `myScroll` variable. You can easily scroll to any position with the following syntax:\n\n```js\nmyScroll.scrollTo(0, -100);\n```\n\nThat would scroll down by 100 pixels. Remember: 0 is always the top left corner. To scroll you have to pass negative numbers.\n\n`time` and `easing` are optional. They regulates the duration (in ms) and the easing function of the animation respectively.\n\nThe easing functions are available in the `IScroll.utils.ease` object. For example to apply a 1 second elastic easing you'd do:\n\n```js\nmyScroll.scrollTo(0, -100, 1000, IScroll.utils.ease.elastic);\n```\n\nThe available options are: `quadratic`, `circular`, `back`, `bounce`, `elastic`.\n\n### scrollBy(x, y, time, easing)\n\nSame as above but X and Y are relative to the current position.\n\n```js\nmyScroll.scrollBy(0, -10);\n```\n    \nWould scroll 10 pixels down. If you are at -100, you'll end up at -110.\n\n### scrollToElement(el, time, offsetX, offsetY, easing)\n\nYou're gonna like this. Sit tight.\n\nThe only mandatory parameter is `el`. Pass an element or a selector and iScroll will try to scroll to the top/left of that element.\n\n`time` is optional and sets the animation duration.\n\n`offsetX` and `offsetY` define an offset in pixels, so that you can scroll to that element plus a the specified offset. Not only that. If you set them to `true` the element will be centered on screen. Refer to the [scroll to element](http://lab.cubiq.org/iscroll5/demos/scroll-to-element/) example.\n\n`easing` works the same way as per the **scrollTo** method.\n\n<h2 id=\"snap\">Snap</h2>\n\niScroll can snap to fixed positions and elements.\n\n### <small>options.</small>snap\n\nThe simplest snap config is as follow:\n\n```js\nvar myScroll = new IScroll('#wrapper', {\n    snap: true\n});\n```\n\nThis would automatically split the scroller into pages the size of the container.\n\n`snap` also takes a string as a value. The string will be the selector to the elements the scroller will be snapped to. So the following\n\n```js\nvar myScroll = new IScroll('#wrapper', {\n    snap: 'li'\n});\n```\n\nwould snap to each and every `LI` tag.\n\nTo help you navigate through the snap points iScroll grants access to a series of interesting methods.\n\n### goToPage(x, y, time, easing)\n\n`x` and `y` represent the page number you want to scroll to in the horizontal or vertical axes (yeah, it's the plural of *axis*, I checked). If the scroller in mono-dimensional, just pass `0` to the axis you don't need.\n\n`time` is the duration of the animation, `easing` the easing function used to scroll to the point. Refer to the **option.bounceEasing** in the [Advanced options](#advanced-options). They are both optional.\n\n```js\nmyScroll.goToPage(10, 0, 1000);\n```\n\nThis would scroll to the 10th page on the horizontal axis in 1 second.\n\n### next()<br/>prev()\n\nGo to the next and previous page based on current position.\n\n<h2 id=\"zoom\">Zoom</h2>\n\nTo use the pinch/zoom functionality you better use the `iscroll-zoom.js` script.\n\n### <small>options.</small>zoom\n\nSet this to `true` to activate zoom.\n\nDefault: `false`\n\n### <small>options.</small>zoomMax\n\nMaximum zoom level.\n\nDefault: `4`\n\n### <small>options.</small>zoomMin\n\nMinimum zoom level.\n\nDefault: `1`\n\n### <small>options.</small>startZoom\n\nStarting zoom level.\n\nDefault: `1`\n\n### <small>options.</small>wheelAction\n\nWheel action can be set to `'zoom'` to have the wheel regulate the zoom level instead of scrolling position.\n\nDefault: `undefined` (ie: the mouse wheel scrolls)\n\nTo sum up, a nice zoom config would be:\n\n```js\nmyScroll = new IScroll('#wrapper', {\n    zoom: true,\n    mouseWheel: true,\n    wheelAction: 'zoom'\n});\n```\n\n<div class=\"important\">\n<p>The zoom is performed with CSS transform. iScroll can zoom only on browsers that support that.</p>\n</div>\n\n<div class=\"tip\">\n<p>Some browsers (notably webkit based ones) take a snapshot of the zooming area as soon as they are placed on the hardware compositing layer (say as soon as you apply a transform to them). This snapshot is used as a texture for the zooming area and it can hardly be updated. This means that your texture will be based on elements at <strong>scale 1</strong> and zooming in will result in blurred, low definition text and images.</p>\n\n<p>A simple solution is to load content at double (or triple) its actual resolution and scale it down inside a <code>scale(0.5)</code> div. This should be enough to grant you a better result. I hope to be able to post more demos soon</p>\n</div>\n\nRefer to the [zoom demo](http://lab.cubiq.org/iscroll5/demos/zoom/).\n\n### zoom(scale, x, y, time)\n\nJuicy method that lets you zoom programmatically.\n\n`scale` is the zoom factor.\n\n`x` and `y` the focus point, aka the center of the zoom. If not specified, the center of the screen will be used.\n\n`time` is the duration of the animation in milliseconds (optional).\n\n<h2 id=\"infinite-scrolling\">Infinite scrolling</h2>\n\niScroll integrates a smart caching system that allows to handle of a virtually infinite amount of data using (and reusing) just a bunch of elements.\n\nInfinite scrolling is in an early stage of development and although it can be considered stable, it is not ready for wide consumption.\n\nPlease review the [infinite demo](http://lab.cubiq.org/iscroll5/demos/infinite/) and send your suggestions and bug reports.\n\nI will add more details as soon as the functionality evolves.\n\n<h2 id=\"advanced-options\">Advanced options</h2>\n\nFor the hardcore developer.\n\n### <small>options.</small>bindToWrapper\n\nThe `move` event is normally bound to the document and not the scroll container. When you move the cursor/finger out of the wrapper the scrolling keeps going. This is usually what you want, but you can also bind the move event to wrapper itself. Doing so as soon as the pointer leaves the container the scroll stops.\n\nDefault: `false`\n\n### <small>options.</small>bounceEasing\n\nEasing function performed during the bounce animation. Valid values are: `'quadratic'`, `'circular'`, `'back'`, `'bounce'`, `'elastic'`. See the [bounce easing demo](http://lab.cubiq.org/iscroll5/demos/bounce-easing/), drag the scroller down and release.\n\n`bounceEasing` is a bit smarter than that. You can also feed a custom easing function, like so:\n\n```js\nbounceEasing: {\n    style: 'cubic-bezier(0,0,1,1)',\n    fn: function (k) { return k; }\n}\n```\n\nThe above would perform a linear easing. The `style` option is used every time the animation is executed with CSS transitions, `fn` is used with `requestAnimationFrame`. If the easing function is too complex and can't be represented by a cubic bezier just pass `''` (empty string) as `style`.\n\nNote that `bounce` and `elastic` can't be performed by CSS transitions.\n\nDefault: `'circular'`\n\n### <small>options.</small>bounceTime\n\nDuration in millisecond of the bounce animation.\n\nDefault: `600`\n\n### <small>options.</small>deceleration\n\nThis value can be altered to change the momentum animation duration/speed. Higher numbers make the animation shorter. Sensible results can be experienced starting with a value of `0.01`, bigger than that basically doesn't make any momentum at all.\n\nDefault: `0.0006`\n\n### <small>options.</small>mouseWheelSpeed\n\nSet the speed of the mouse wheel.\n\nDefault: `20`\n\n### <small>options.</small>preventDefaultException\n\nThese are all the exceptions when `preventDefault()` would be fired anyway despite the **preventDefault** option value.\n\nThis is a pretty powerful option, if you don't want to `preventDefault()` on all elements with *formfield* class name for example, you could pass the following:\n\n```js\npreventDefaultException: { className: /(^|\\s)formfield(\\s|$)/ }\n```\n\nDefault: `{ tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ }`.\n\n### <small>options.</small>resizePolling\n\nWhen you resize the window iScroll has to recalculate elements position and dimension. This might be a pretty daunting task for the poor little fella. To give it some rest the polling is set to 60 milliseconds.\n\nBy reducing this value you get better visual effect but the script becomes more aggressive on the CPU. The default value seems a good compromise.\n\nDefault: `60`\n\n<h2 id=\"refresh\">Mastering the refresh method</h2>\n\niScroll needs to know the exact dimensions of both the wrapper and the scroller. They are computed at start up but if your elements change in size, we need to tell iScroll that you are messing with the DOM.\n\nThis is achieved by calling the `refresh` method with the right timing. Please follow me closely, understanding this will save you hours of frustration.\n\nEvery time you touch the DOM the browser renderer repaints the page. Once this repaint has happened we can safely read the new DOM properties. The repaint phase is not instantaneous and it happens only at the end of the scope that triggered it. That's why we need to give the renderer a little rest before refreshing the iScroll.\n\nTo ensure that javascript gets the updated properties you should defer the refresh with something like this:\n\n```js\najax('page.php', onCompletion);\n\nfunction onCompletion () {\n    // Update here your DOM\n    \n    setTimeout(function () {\n        myScroll.refresh();\n    }, 0);\n};\n```\n\nWe have placed the `refresh()` call into a zero timeout. That is likely all you need to correctly refresh the iScroll boundaries. There are other ways to wait for the repaint, but the zero-timeout has proven pretty solid.\n\n<div class=\"tip\">\n<p>Consider that if you have a very complex HTML structure you may give the browser some more rest and raise the timeout to 100 or 200 milliseconds.</p>\n\n<p>This is generally true for all the tasks that have to be done on the DOM. Always give the renderer some rest.</p>\n</div>\n\n<h2 id=\"custom-events\">Custom events</h2>\n\niScroll also emits some useful custom events you can hook to.\n\nTo register them you use the `on(type, fn)` method.\n\n```js\nmyScroll = new IScroll('#wrapper');\nmyScroll.on('scrollEnd', doSomething);\n```\n\nThe above code executes the `doSomething` function every time the content stops scrolling.\n\nThe available types are:\n\n* **beforeScrollStart**, executed as soon as user touches the screen but before the scrolling has initiated.\n* **scrollCancel**, scroll initiated but didn't happen.\n* **scrollStart**, the scroll started.\n* **scroll**, the content is scrolling. Available only in `scroll-probe.js` edition. See [onScroll event](#onscroll).\n* **scrollEnd**, content stopped scrolling.\n* **flick**, user flicked left/right.\n* **zoomStart**, user started zooming.\n* **zoomEnd**, zoom ended.\n\n<h2 id=\"onscroll\">onScroll event</h2>\n\nThe `scroll` event is available on **iScroll probe edition** only (`iscroll-probe.js`). The probe behavior can be altered through the `probeType` option.\n\n### <small>options.</small>probeType\n\nThis regulates the probe aggressiveness or the frequency at which the `scroll` event is fired. Valid values are: `1`, `2`, `3`. The higher the number the more aggressive the probe. The more aggressive the probe the higher the impact on the CPU.\n\n`probeType: 1` has no impact on performance. The `scroll` event is fired only when the scroller is not busy doing its stuff.\n\n`probeType: 2` always executes the `scroll` event except during momentum and bounce. This resembles the native `onScroll` event.\n\n`probeType: 3` emits the `scroll` event with a to-the-pixel precision. Note that the scrolling is forced to `requestAnimationFrame` (ie: `useTransition:false`).\n\nPlease see the [probe demo](http://lab.cubiq.org/iscroll5/demos/probe/).\n\n<h2 id=\"key-bindings\">Key bindings</h2>\n\nYou can activate support for keyboards and remote controls with the `keyBindings` option. By default iScroll listens to the arrow keys, page up/down, home/end but they are (wait for it) totally customizable.\n\nYou can pass an object with the list of key codes you want iScroll to react to.\n\nThe default values are as follow:\n\n```js\nkeyBindings: {\n    pageUp: 33,\n    pageDown: 34,\n    end: 35,\n    home: 36,\n    left: 37,\n    up: 38,\n    right: 39,\n    down: 40\n}\n```\n\nYou can also pass a string (eg: `pageUp: 'a'`) and iScroll will convert it for you. You could just think of a key code and iScroll would read it out of your mind.\n\n<h2 id=\"scroller-info\">Useful scroller info</h2>\n\niScroll stores many useful information that you can use to augment your application.\n\nYou will probably find useful:\n\n* **myScroll.x/y**, current position\n* **myScroll.directionX/Y**, last direction (-1 down/right, 0 still, 1 up/left)\n* **myScroll.currentPage**, current snap point info\n\nThese pieces of information may be useful when dealing with custom events. Eg:\n\n```js\nmyScroll = new IScroll('#wrapper');\nmyScroll.on('scrollEnd', function () {\n    if ( this.x < -1000 ) {\n        // do something\n    }\n});\n```\n\nThe above executes some code if the `x` position is lower than -1000px when the scroller stops. Note that I used `this` instead of `myScroll`, you can use both of course, but iScroll passes itself as `this` context when firing custom event functions.\n\n<h2 id=\"destroy\">Destroy</h2>\n\nThe public `destroy()` method can be used to free some memory when the iScroll is not needed anymore.\n\n```js\nmyScroll.destroy();\nmyScroll = null;\n```\n\n<h2 id=\"contributing\">Contributing and CLA</h2>\n\nIf you want to contribute to the iScroll development, before I can accept your submission I have to ask you to sign the [Contributor License Agreement](http://cubiq.org/iscroll/cla/). Unfortunately that is the only way to enforce the openness of the script.\n\nAs an end user you have to do nothing of course. Actually the CLA ensures that nobody will even come after you asking for your first born for using the iScroll.\n\nPlease note that pull requests may take some time to be accepted. Testing iScroll is one of the most time consuming tasks of the project. iScroll works from desktop to smartphone, from tablets to smart TVs. I do not have physical access to all the testing devices, so before I can push a change I have to make sure that the new code is working everywhere.\n\nCritical bugs are usually applied very quickly, but enhancements and coding style changes have to pass a longer review phase. *Remember that this is still a side project for me.*\n\n<h2 id=\"whos\">Who is using iScroll</h2>\n\nIt's impossible to track all the websites and applications that use the iScroll. It has been spotted on: Apple, Microsoft, People, LinkedIn, IKEA, Nike, Playboy, Bose, and countless others.\n\n<h2 id=\"license\">License (MIT)</h2>\n\n\nCopyright (c) 2014 Matteo Spinelli, [cubiq.org](http://cubiq.org/)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "RELEASENOTES.md",
    "content": "# Release notes for iScroll\n\n---\n\n##  Version 5.2.0 - 2016.04.05\n\n### Fixes\n* Fixes weird scrolling in Chrome (#760, #441, #943, #927, #780)\n* [#1009](https://github.com/cubiq/iscroll/issues/1009) fixes utils.prefixPointerEvent method\n* [#1018](https://github.com/cubiq/iscroll/issues/1018), [#652](https://github.com/cubiq/iscroll/issues/652) fixes directionX/Y when scrolling with mouse\n* [#924](https://github.com/cubiq/iscroll/issues/924), [#950](https://github.com/cubiq/iscroll/issues/950) clean up timer on destroy\n* [#949](https://github.com/cubiq/iscroll/issues/949) removes unnecesary style values on wrapper when useTransition option is 'false'\n* [#361](https://github.com/cubiq/iscroll/issues/361) fixes two click/tap events issue\n* [#980](https://github.com/cubiq/iscroll/issues/980) fixes event propagation for wheel event\n* [#768](https://github.com/cubiq/iscroll/issues/768) fixes indicators\n* [#761](https://github.com/cubiq/iscroll/issues/761) fixes two scrollEnd events issue\n* Fixes 'click' event is not fired when iScroll is disabled\n\n### Changes\n* Added AMD support\n* Changed default value of disableMouse/disableTouch/disablePointer options\n* Removed CLA non-sense\n\n---\n\n##  Version 5.1.3 - 2014.09.19\n\n### Fixes\n* [#577](https://github.com/cubiq/iscroll/issues/577) fixes scrolling in Firefox\n\n---\n\n##  Version 5.1.2 - 2014.06.02\n\n### Fixes\n* [#707](https://github.com/cubiq/iscroll/pull/707) fixes build fail when dist folder does not exist\n* [#713](https://github.com/cubiq/iscroll/pull/713) Adds W3C pointer support and fixes issue with `MSPointerEvent` detection\n\n---\n\n##  Version 5.1.1 - 2014.01.10\n\n### Fixes\n* Infinite scroll now switch from `transform` to `top/left` based on `useTransform` option\n* [#555](https://github.com/cubiq/iscroll/issues/555) removed unused variable\n* [#372](https://github.com/cubiq/iscroll/issues/372) case insensitive check on tag names\n\n### New features\n* New `off` method to unload custom events\n* Added `options.deceleration` to alter the momentum duration/speed\n* Added release notes file\n\n---\n\n##  Version 5.1.0 - 2014.01.09\n\n### Fixes\n* [#558](https://github.com/cubiq/iscroll/issues/558) false positive for `isBadAndroid`\n\n### New features\n* Infinite scrolling\n* Documentation\n* `_execEvent` supports arguments\n\n### Changes\n* dist/minified files are no longer pushed to the main repo\n\n---\n\n*I started collecting release notes from version 5.1.0*\n"
  },
  {
    "path": "bower.json",
    "content": "{\n  \"name\": \"iscroll\",\n  \"description\": \"Smooth scrolling for the web\",\n  \"main\": [\n    \"build/iscroll.js\"\n  ],\n  \"moduleType\": [\n    \"amd\",\n    \"node\",\n    \"globals\"\n  ],\n  \"keywords\": [\n    \"scrolling\",\n    \"carousel\",\n    \"zoom\",\n    \"iphone\",\n    \"android\",\n    \"mobile\",\n    \"desktop\"\n  ],\n  \"authors\": [\n    \"Matteo Spinelli <matteo@cubiq.org> (http://cubiq.org)\"\n  ],\n  \"license\": \"MIT\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/cubiq/iscroll.git\"\n  },\n  \"homepage\": \"http://iscrolljs.com\",\n  \"ignore\": [\n    \"**/.*\",\n    \"build/*\",\n    \"dist/*\",\n    \"demos/*\",\n    \"*.md\",\n    \"*.tmp\",\n    \"build.js\",\n    \"package.json\"\n  ]\n}\n"
  },
  {
    "path": "build/iscroll-infinite.js",
    "content": "/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */\n(function (window, document, Math) {\nvar rAF = window.requestAnimationFrame\t||\n\twindow.webkitRequestAnimationFrame\t||\n\twindow.mozRequestAnimationFrame\t\t||\n\twindow.oRequestAnimationFrame\t\t||\n\twindow.msRequestAnimationFrame\t\t||\n\tfunction (callback) { window.setTimeout(callback, 1000 / 60); };\n\nvar utils = (function () {\n\tvar me = {};\n\n\tvar _elementStyle = document.createElement('div').style;\n\tvar _vendor = (function () {\n\t\tvar vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],\n\t\t\ttransform,\n\t\t\ti = 0,\n\t\t\tl = vendors.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\ttransform = vendors[i] + 'ransform';\n\t\t\tif ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);\n\t\t}\n\n\t\treturn false;\n\t})();\n\n\tfunction _prefixStyle (style) {\n\t\tif ( _vendor === false ) return false;\n\t\tif ( _vendor === '' ) return style;\n\t\treturn _vendor + style.charAt(0).toUpperCase() + style.substr(1);\n\t}\n\n\tme.getTime = Date.now || function getTime () { return new Date().getTime(); };\n\n\tme.extend = function (target, obj) {\n\t\tfor ( var i in obj ) {\n\t\t\ttarget[i] = obj[i];\n\t\t}\n\t};\n\n\tme.addEvent = function (el, type, fn, capture) {\n\t\tel.addEventListener(type, fn, !!capture);\n\t};\n\n\tme.removeEvent = function (el, type, fn, capture) {\n\t\tel.removeEventListener(type, fn, !!capture);\n\t};\n\n\tme.prefixPointerEvent = function (pointerEvent) {\n\t\treturn window.MSPointerEvent ?\n\t\t\t'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):\n\t\t\tpointerEvent;\n\t};\n\n\tme.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {\n\t\tvar distance = current - start,\n\t\t\tspeed = Math.abs(distance) / time,\n\t\t\tdestination,\n\t\t\tduration;\n\n\t\tdeceleration = deceleration === undefined ? 0.0006 : deceleration;\n\n\t\tdestination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\n\t\tduration = speed / deceleration;\n\n\t\tif ( destination < lowerMargin ) {\n\t\t\tdestination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\n\t\t\tdistance = Math.abs(destination - current);\n\t\t\tduration = distance / speed;\n\t\t} else if ( destination > 0 ) {\n\t\t\tdestination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\n\t\t\tdistance = Math.abs(current) + destination;\n\t\t\tduration = distance / speed;\n\t\t}\n\n\t\treturn {\n\t\t\tdestination: Math.round(destination),\n\t\t\tduration: duration\n\t\t};\n\t};\n\n\tvar _transform = _prefixStyle('transform');\n\n\tme.extend(me, {\n\t\thasTransform: _transform !== false,\n\t\thasPerspective: _prefixStyle('perspective') in _elementStyle,\n\t\thasTouch: 'ontouchstart' in window,\n\t\thasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed\n\t\thasTransition: _prefixStyle('transition') in _elementStyle\n\t});\n\n\t/*\n\tThis should find all Android browsers lower than build 535.19 (both stock browser and webview)\n\t- galaxy S2 is ok\n    - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`\n    - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S3 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S4 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S5 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n   - galaxy S6 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n  */\n\tme.isBadAndroid = (function() {\n\t\tvar appVersion = window.navigator.appVersion;\n\t\t// Android browser is not a chrome browser.\n\t\tif (/Android/.test(appVersion) && !(/Chrome\\/\\d/.test(appVersion))) {\n\t\t\tvar safariVersion = appVersion.match(/Safari\\/(\\d+.\\d)/);\n\t\t\tif(safariVersion && typeof safariVersion === \"object\" && safariVersion.length >= 2) {\n\t\t\t\treturn parseFloat(safariVersion[1]) < 535.19;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\tme.extend(me.style = {}, {\n\t\ttransform: _transform,\n\t\ttransitionTimingFunction: _prefixStyle('transitionTimingFunction'),\n\t\ttransitionDuration: _prefixStyle('transitionDuration'),\n\t\ttransitionDelay: _prefixStyle('transitionDelay'),\n\t\ttransformOrigin: _prefixStyle('transformOrigin'),\n\t\ttouchAction: _prefixStyle('touchAction')\n\t});\n\n\tme.hasClass = function (e, c) {\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\");\n\t\treturn re.test(e.className);\n\t};\n\n\tme.addClass = function (e, c) {\n\t\tif ( me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar newclass = e.className.split(' ');\n\t\tnewclass.push(c);\n\t\te.className = newclass.join(' ');\n\t};\n\n\tme.removeClass = function (e, c) {\n\t\tif ( !me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\", 'g');\n\t\te.className = e.className.replace(re, ' ');\n\t};\n\n\tme.offset = function (el) {\n\t\tvar left = -el.offsetLeft,\n\t\t\ttop = -el.offsetTop;\n\n\t\t// jshint -W084\n\t\twhile (el = el.offsetParent) {\n\t\t\tleft -= el.offsetLeft;\n\t\t\ttop -= el.offsetTop;\n\t\t}\n\t\t// jshint +W084\n\n\t\treturn {\n\t\t\tleft: left,\n\t\t\ttop: top\n\t\t};\n\t};\n\n\tme.preventDefaultException = function (el, exceptions) {\n\t\tfor ( var i in exceptions ) {\n\t\t\tif ( exceptions[i].test(el[i]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tme.extend(me.eventType = {}, {\n\t\ttouchstart: 1,\n\t\ttouchmove: 1,\n\t\ttouchend: 1,\n\n\t\tmousedown: 2,\n\t\tmousemove: 2,\n\t\tmouseup: 2,\n\n\t\tpointerdown: 3,\n\t\tpointermove: 3,\n\t\tpointerup: 3,\n\n\t\tMSPointerDown: 3,\n\t\tMSPointerMove: 3,\n\t\tMSPointerUp: 3\n\t});\n\n\tme.extend(me.ease = {}, {\n\t\tquadratic: {\n\t\t\tstyle: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n\t\t\tfn: function (k) {\n\t\t\t\treturn k * ( 2 - k );\n\t\t\t}\n\t\t},\n\t\tcircular: {\n\t\t\tstyle: 'cubic-bezier(0.1, 0.57, 0.1, 1)',\t// Not properly \"circular\" but this looks better, it should be (0.075, 0.82, 0.165, 1)\n\t\t\tfn: function (k) {\n\t\t\t\treturn Math.sqrt( 1 - ( --k * k ) );\n\t\t\t}\n\t\t},\n\t\tback: {\n\t\t\tstyle: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n\t\t\tfn: function (k) {\n\t\t\t\tvar b = 4;\n\t\t\t\treturn ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;\n\t\t\t}\n\t\t},\n\t\tbounce: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tif ( ( k /= 1 ) < ( 1 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * k * k;\n\t\t\t\t} else if ( k < ( 2 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n\t\t\t\t} else if ( k < ( 2.5 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n\t\t\t\t} else {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\telastic: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tvar f = 0.22,\n\t\t\t\t\te = 0.4;\n\n\t\t\t\tif ( k === 0 ) { return 0; }\n\t\t\t\tif ( k == 1 ) { return 1; }\n\n\t\t\t\treturn ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );\n\t\t\t}\n\t\t}\n\t});\n\n\tme.tap = function (e, eventName) {\n\t\tvar ev = document.createEvent('Event');\n\t\tev.initEvent(eventName, true, true);\n\t\tev.pageX = e.pageX;\n\t\tev.pageY = e.pageY;\n\t\te.target.dispatchEvent(ev);\n\t};\n\n\tme.click = function (e) {\n\t\tvar target = e.target,\n\t\t\tev;\n\n\t\tif ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n\t\t\t// initMouseEvent is deprecated.\n\t\t\tev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');\n\t\t\tev.initEvent('click', true, true);\n\t\t\tev.view = e.view || window;\n\t\t\tev.detail = 1;\n\t\t\tev.screenX = target.screenX || 0;\n\t\t\tev.screenY = target.screenY || 0;\n\t\t\tev.clientX = target.clientX || 0;\n\t\t\tev.clientY = target.clientY || 0;\n\t\t\tev.ctrlKey = !!e.ctrlKey;\n\t\t\tev.altKey = !!e.altKey;\n\t\t\tev.shiftKey = !!e.shiftKey;\n\t\t\tev.metaKey = !!e.metaKey;\n\t\t\tev.button = 0;\n\t\t\tev.relatedTarget = null;\n\t\t\tev._constructed = true;\n\t\t\ttarget.dispatchEvent(ev);\n\t\t}\n\t};\n\n\tme.getTouchAction = function(eventPassthrough, addPinch) {\n\t\tvar touchAction = 'none';\n\t\tif ( eventPassthrough === 'vertical' ) {\n\t\t\ttouchAction = 'pan-y';\n\t\t} else if (eventPassthrough === 'horizontal' ) {\n\t\t\ttouchAction = 'pan-x';\n\t\t}\n\t\tif (addPinch && touchAction != 'none') {\n\t\t\t// add pinch-zoom support if the browser supports it, but if not (eg. Chrome <55) do nothing\n\t\t\ttouchAction += ' pinch-zoom';\n\t\t}\n\t\treturn touchAction;\n\t};\n\n\tme.getRect = function(el) {\n\t\tif (el instanceof SVGElement) {\n\t\t\tvar rect = el.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop : rect.top,\n\t\t\t\tleft : rect.left,\n\t\t\t\twidth : rect.width,\n\t\t\t\theight : rect.height\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttop : el.offsetTop,\n\t\t\t\tleft : el.offsetLeft,\n\t\t\t\twidth : el.offsetWidth,\n\t\t\t\theight : el.offsetHeight\n\t\t\t};\n\t\t}\n\t};\n\n\treturn me;\n})();\nfunction IScroll (el, options) {\n\tthis.wrapper = typeof el == 'string' ? document.querySelector(el) : el;\n\tthis.scroller = this.wrapper.children[0];\n\tthis.scrollerStyle = this.scroller.style;\t\t// cache style for better performance\n\n\tthis.options = {\n\n\t\tmouseWheelSpeed: 20,\n\n\t\tsnapThreshold: 0.334,\n\n\t\tinfiniteUseTransform: true,\n\t\tdeceleration: 0.004,\n\n// INSERT POINT: OPTIONS\n\t\tdisablePointer : !utils.hasPointer,\n\t\tdisableTouch : utils.hasPointer || !utils.hasTouch,\n\t\tdisableMouse : utils.hasPointer || utils.hasTouch,\n\t\tstartX: 0,\n\t\tstartY: 0,\n\t\tscrollY: true,\n\t\tdirectionLockThreshold: 5,\n\t\tmomentum: true,\n\n\t\tbounce: true,\n\t\tbounceTime: 600,\n\t\tbounceEasing: '',\n\n\t\tpreventDefault: true,\n\t\tpreventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },\n\n\t\tHWCompositing: true,\n\t\tuseTransition: true,\n\t\tuseTransform: true,\n\t\tbindToWrapper: typeof window.onmousedown === \"undefined\"\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\t// Normalize options\n\tthis.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';\n\n\tthis.options.useTransition = utils.hasTransition && this.options.useTransition;\n\tthis.options.useTransform = utils.hasTransform && this.options.useTransform;\n\n\tthis.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;\n\tthis.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;\n\n\t// If you want eventPassthrough I have to lock one of the axes\n\tthis.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;\n\tthis.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;\n\n\t// With eventPassthrough we also need lockDirection mechanism\n\tthis.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;\n\tthis.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;\n\n\tthis.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;\n\n\tthis.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;\n\n\tif ( this.options.tap === true ) {\n\t\tthis.options.tap = 'tap';\n\t}\n\n\t// https://github.com/cubiq/iscroll/issues/1029\n\tif (!this.options.useTransition && !this.options.useTransform) {\n\t\tif(!(/relative|absolute/i).test(this.scrollerStyle.position)) {\n\t\t\tthis.scrollerStyle.position = \"relative\";\n\t\t}\n\t}\n\n\tthis.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;\n\n\tif ( this.options.infiniteElements ) {\n\t\tthis.options.probeType = 3;\n\t}\n\tthis.options.infiniteUseTransform = this.options.infiniteUseTransform && this.options.useTransform;\n\n\tif ( this.options.probeType == 3 ) {\n\t\tthis.options.useTransition = false;\t}\n\n// INSERT POINT: NORMALIZATION\n\n\t// Some defaults\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.directionX = 0;\n\tthis.directionY = 0;\n\tthis._events = {};\n\n// INSERT POINT: DEFAULTS\n\n\tthis._init();\n\tthis.refresh();\n\n\tthis.scrollTo(this.options.startX, this.options.startY);\n\tthis.enable();\n}\n\nIScroll.prototype = {\n\tversion: '5.2.0-snapshot',\n\n\t_init: function () {\n\t\tthis._initEvents();\n\n\t\tif ( this.options.mouseWheel ) {\n\t\t\tthis._initWheel();\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tthis._initSnap();\n\t\t}\n\n\t\tif ( this.options.keyBindings ) {\n\t\t\tthis._initKeys();\n\t\t}\n\n\t\tif ( this.options.infiniteElements ) {\n\t\t\tthis._initInfinite();\n\t\t}\n\n// INSERT POINT: _init\n\n\t},\n\n\tdestroy: function () {\n\t\tthis._initEvents(true);\n\t\tclearTimeout(this.resizeTimeout);\n \t\tthis.resizeTimeout = null;\n\t\tthis._execEvent('destroy');\n\t},\n\n\t_transitionEnd: function (e) {\n\t\tif ( e.target != this.scroller || !this.isInTransition ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._transitionTime();\n\t\tif ( !this.resetPosition(this.options.bounceTime) ) {\n\t\t\tthis.isInTransition = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\t// React to left mouse button only\n\t\tif ( utils.eventType[e.type] != 1 ) {\n\t\t  // for button property\n\t\t  // http://unixpapa.com/js/mouse.html\n\t\t  var button;\n\t    if (!e.which) {\n\t      /* IE case */\n\t      button = (e.button < 2) ? 0 :\n\t               ((e.button == 4) ? 1 : 2);\n\t    } else {\n\t      /* All others */\n\t      button = e.button;\n\t    }\n\t\t\tif ( button !== 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tpos;\n\n\t\tthis.initiated\t= utils.eventType[e.type];\n\t\tthis.moved\t\t= false;\n\t\tthis.distX\t\t= 0;\n\t\tthis.distY\t\t= 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\tthis.directionLocked = 0;\n\n\t\tthis.startTime = utils.getTime();\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tthis._transitionTime();\n\t\t\tthis.isInTransition = false;\n\t\t\tpos = this.getComputedPosition();\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis._execEvent('scrollEnd');\n\t\t} else if ( !this.options.useTransition && this.isAnimating ) {\n\t\t\tthis.isAnimating = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\n\t\tthis.startX    = this.x;\n\t\tthis.startY    = this.y;\n\t\tthis.absStartX = this.x;\n\t\tthis.absStartY = this.y;\n\t\tthis.pointX    = point.pageX;\n\t\tthis.pointY    = point.pageY;\n\n\t\tthis._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\t// increases performance on Android? TODO: check!\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point\t\t= e.touches ? e.touches[0] : e,\n\t\t\tdeltaX\t\t= point.pageX - this.pointX,\n\t\t\tdeltaY\t\t= point.pageY - this.pointY,\n\t\t\ttimestamp\t= utils.getTime(),\n\t\t\tnewX, newY,\n\t\t\tabsDistX, absDistY;\n\n\t\tthis.pointX\t\t= point.pageX;\n\t\tthis.pointY\t\t= point.pageY;\n\n\t\tthis.distX\t\t+= deltaX;\n\t\tthis.distY\t\t+= deltaY;\n\t\tabsDistX\t\t= Math.abs(this.distX);\n\t\tabsDistY\t\t= Math.abs(this.distY);\n\n\t\t// We need to move at least 10 pixels for the scrolling to initiate\n\t\tif ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If you are scrolling in one direction lock the other\n\t\tif ( !this.directionLocked && !this.options.freeScroll ) {\n\t\t\tif ( absDistX > absDistY + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'h';\t\t// lock horizontally\n\t\t\t} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'v';\t\t// lock vertically\n\t\t\t} else {\n\t\t\t\tthis.directionLocked = 'n';\t\t// no lock\n\t\t\t}\n\t\t}\n\n\t\tif ( this.directionLocked == 'h' ) {\n\t\t\tif ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaY = 0;\n\t\t} else if ( this.directionLocked == 'v' ) {\n\t\t\tif ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaX = 0;\n\t\t}\n\n\t\tdeltaX = this.hasHorizontalScroll ? deltaX : 0;\n\t\tdeltaY = this.hasVerticalScroll ? deltaY : 0;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\t// Slow down if outside of the boundaries\n\t\tif ( newX > 0 || newX < this.maxScrollX ) {\n\t\t\tnewX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;\n\t\t}\n\t\tif ( newY > 0 || newY < this.maxScrollY ) {\n\t\t\tnewY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;\n\t\t}\n\n\t\tthis.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;\n\t\tthis.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;\n\n\t\tif ( !this.moved ) {\n\t\t\tthis._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tthis._translate(newX, newY);\n\n/* REPLACE START: _move */\n\t\tif ( timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.startX = this.x;\n\t\t\tthis.startY = this.y;\n\n\t\t\tif ( this.options.probeType == 1 ) {\n\t\t\t\tthis._execEvent('scroll');\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.probeType > 1 ) {\n\t\t\tthis._execEvent('scroll');\n\t\t}\n/* REPLACE END: _move */\n\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.changedTouches ? e.changedTouches[0] : e,\n\t\t\tmomentumX,\n\t\t\tmomentumY,\n\t\t\tduration = utils.getTime() - this.startTime,\n\t\t\tnewX = Math.round(this.x),\n\t\t\tnewY = Math.round(this.y),\n\t\t\tdistanceX = Math.abs(newX - this.startX),\n\t\t\tdistanceY = Math.abs(newY - this.startY),\n\t\t\ttime = 0,\n\t\t\teasing = '';\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\t\tthis.endTime = utils.getTime();\n\n\t\t// reset if we are outside of the boundaries\n\t\tif ( this.resetPosition(this.options.bounceTime) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY);\t// ensures that the last position is rounded\n\n\t\t// we scrolled less than 10 pixels\n\t\tif ( !this.moved ) {\n\t\t\tif ( this.options.tap ) {\n\t\t\t\tutils.tap(e, this.options.tap);\n\t\t\t}\n\n\t\t\tif ( this.options.click ) {\n\t\t\t\tutils.click(e);\n\t\t\t}\n\n\t\t\tthis._execEvent('scrollCancel');\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {\n\t\t\tthis._execEvent('flick');\n\t\t\treturn;\n\t\t}\n\n\t\t// start momentum animation if needed\n\t\tif ( this.options.momentum && duration < 300 ) {\n\t\t\tmomentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };\n\t\t\tmomentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };\n\t\t\tnewX = momentumX.destination;\n\t\t\tnewY = momentumY.destination;\n\t\t\ttime = Math.max(momentumX.duration, momentumY.duration);\n\t\t\tthis.isInTransition = 1;\n\t\t}\n\n\n\t\tif ( this.options.snap ) {\n\t\t\tvar snap = this._nearestSnap(newX, newY);\n\t\t\tthis.currentPage = snap;\n\t\t\ttime = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(newX - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(newY - snap.y), 1000)\n\t\t\t\t\t), 300);\n\t\t\tnewX = snap.x;\n\t\t\tnewY = snap.y;\n\n\t\t\tthis.directionX = 0;\n\t\t\tthis.directionY = 0;\n\t\t\teasing = this.options.bounceEasing;\n\t\t}\n\n// INSERT POINT: _end\n\n\t\tif ( newX != this.x || newY != this.y ) {\n\t\t\t// change easing function when scroller goes out of the boundaries\n\t\t\tif ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {\n\t\t\t\teasing = utils.ease.quadratic;\n\t\t\t}\n\n\t\t\tthis.scrollTo(newX, newY, time, easing);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._execEvent('scrollEnd');\n\t},\n\n\t_resize: function () {\n\t\tvar that = this;\n\n\t\tclearTimeout(this.resizeTimeout);\n\n\t\tthis.resizeTimeout = setTimeout(function () {\n\t\t\tthat.refresh();\n\t\t}, this.options.resizePolling);\n\t},\n\n\tresetPosition: function (time) {\n\t\tvar x = this.x,\n\t\t\ty = this.y;\n\n\t\ttime = time || 0;\n\n\t\tif ( !this.hasHorizontalScroll || this.x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( this.x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll || this.y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( this.y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tif ( x == this.x && y == this.y ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time, this.options.bounceEasing);\n\n\t\treturn true;\n\t},\n\n\tdisable: function () {\n\t\tthis.enabled = false;\n\t},\n\n\tenable: function () {\n\t\tthis.enabled = true;\n\t},\n\n\trefresh: function () {\n\t\tutils.getRect(this.wrapper);\t\t// Force reflow\n\n\t\tthis.wrapperWidth\t= this.wrapper.clientWidth;\n\t\tthis.wrapperHeight\t= this.wrapper.clientHeight;\n\n\t\tvar rect = utils.getRect(this.scroller);\n/* REPLACE START: refresh */\n\t\tthis.scrollerWidth\t= rect.width;\n\t\tthis.scrollerHeight\t= rect.height;\n\n\t\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\n\t\tvar limit;\n\t\tif ( this.options.infiniteElements ) {\n\t\t\tthis.options.infiniteLimit = this.options.infiniteLimit || Math.floor(2147483645 / this.infiniteElementHeight);\n\t\t\tlimit = -this.options.infiniteLimit * this.infiniteElementHeight + this.wrapperHeight;\n\t\t}\n\t\tthis.maxScrollY\t\t= limit !== undefined ? limit : this.wrapperHeight - this.scrollerHeight;\n/* REPLACE END: refresh */\n\n\t\tthis.hasHorizontalScroll\t= this.options.scrollX && this.maxScrollX < 0;\n\t\tthis.hasVerticalScroll\t\t= this.options.scrollY && this.maxScrollY < 0;\n\t\t\n\t\tif ( !this.hasHorizontalScroll ) {\n\t\t\tthis.maxScrollX = 0;\n\t\t\tthis.scrollerWidth = this.wrapperWidth;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\tthis.maxScrollY = 0;\n\t\t\tthis.scrollerHeight = this.wrapperHeight;\n\t\t}\n\n\t\tthis.endTime = 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\t\n\t\tif(utils.hasPointer && !this.options.disablePointer) {\n\t\t\t// The wrapper should have `touchAction` property for using pointerEvent.\n\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, true);\n\n\t\t\t// case. not support 'pinch-zoom'\n\t\t\t// https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583\n\t\t\tif (!this.wrapper.style[utils.style.touchAction]) {\n\t\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, false);\n\t\t\t}\n\t\t}\n\t\tthis.wrapperOffset = utils.offset(this.wrapper);\n\n\t\tthis._execEvent('refresh');\n\n\t\tthis.resetPosition();\n\n// INSERT POINT: _refresh\n\n\t},\t\n\n\ton: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\tthis._events[type] = [];\n\t\t}\n\n\t\tthis._events[type].push(fn);\n\t},\n\n\toff: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar index = this._events[type].indexOf(fn);\n\n\t\tif ( index > -1 ) {\n\t\t\tthis._events[type].splice(index, 1);\n\t\t}\n\t},\n\n\t_execEvent: function (type) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this._events[type].length;\n\n\t\tif ( !l ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tthis._events[type][i].apply(this, [].slice.call(arguments, 1));\n\t\t}\n\t},\n\n\tscrollBy: function (x, y, time, easing) {\n\t\tx = this.x + x;\n\t\ty = this.y + y;\n\t\ttime = time || 0;\n\n\t\tthis.scrollTo(x, y, time, easing);\n\t},\n\n\tscrollTo: function (x, y, time, easing) {\n\t\teasing = easing || utils.ease.circular;\n\n\t\tthis.isInTransition = this.options.useTransition && time > 0;\n\t\tvar transitionType = this.options.useTransition && easing.style;\n\t\tif ( !time || transitionType ) {\n\t\t\t\tif(transitionType) {\n\t\t\t\t\tthis._transitionTimingFunction(easing.style);\n\t\t\t\t\tthis._transitionTime(time);\n\t\t\t\t}\n\t\t\tthis._translate(x, y);\n\t\t} else {\n\t\t\tthis._animate(x, y, time, easing.fn);\n\t\t}\n\t},\n\n\tscrollToElement: function (el, time, offsetX, offsetY, easing) {\n\t\tel = el.nodeType ? el : this.scroller.querySelector(el);\n\n\t\tif ( !el ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar pos = utils.offset(el);\n\n\t\tpos.left -= this.wrapperOffset.left;\n\t\tpos.top  -= this.wrapperOffset.top;\n\n\t\t// if offsetX/Y are true we center the element to the screen\n\t\tvar elRect = utils.getRect(el);\n\t\tvar wrapperRect = utils.getRect(this.wrapper);\n\t\tif ( offsetX === true ) {\n\t\t\toffsetX = Math.round(elRect.width / 2 - wrapperRect.width / 2);\n\t\t}\n\t\tif ( offsetY === true ) {\n\t\t\toffsetY = Math.round(elRect.height / 2 - wrapperRect.height / 2);\n\t\t}\n\n\t\tpos.left -= offsetX || 0;\n\t\tpos.top  -= offsetY || 0;\n\n\t\tpos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;\n\t\tpos.top  = pos.top  > 0 ? 0 : pos.top  < this.maxScrollY ? this.maxScrollY : pos.top;\n\n\t\ttime = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;\n\n\t\tthis.scrollTo(pos.left, pos.top, time, easing);\n\t},\n\n\t_transitionTime: function (time) {\n\t\tif (!this.options.useTransition) {\n\t\t\treturn;\n\t\t}\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollerStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.scrollerStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.scrollerStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.scrollerStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n// INSERT POINT: _transitionTime\n\n\t},\n\n\t_transitionTimingFunction: function (easing) {\n\t\tthis.scrollerStyle[utils.style.transitionTimingFunction] = easing;\n\n// INSERT POINT: _transitionTimingFunction\n\n\t},\n\n\t_translate: function (x, y) {\n\t\tif ( this.options.useTransform ) {\n\n/* REPLACE START: _translate */\n\n\t\t\tthis.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;\n\n/* REPLACE END: _translate */\n\n\t\t} else {\n\t\t\tx = Math.round(x);\n\t\t\ty = Math.round(y);\n\t\t\tthis.scrollerStyle.left = x + 'px';\n\t\t\tthis.scrollerStyle.top = y + 'px';\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n// INSERT POINT: _translate\n\n\t},\n\n\t_initEvents: function (remove) {\n\t\tvar eventType = remove ? utils.removeEvent : utils.addEvent,\n\t\t\ttarget = this.options.bindToWrapper ? this.wrapper : window;\n\n\t\teventType(window, 'orientationchange', this);\n\t\teventType(window, 'resize', this);\n\n\t\tif ( this.options.click ) {\n\t\t\teventType(this.wrapper, 'click', this, true);\n\t\t}\n\n\t\tif ( !this.options.disableMouse ) {\n\t\t\teventType(this.wrapper, 'mousedown', this);\n\t\t\teventType(target, 'mousemove', this);\n\t\t\teventType(target, 'mousecancel', this);\n\t\t\teventType(target, 'mouseup', this);\n\t\t}\n\n\t\tif ( utils.hasPointer && !this.options.disablePointer ) {\n\t\t\teventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointermove'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointercancel'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\n\t\tif ( utils.hasTouch && !this.options.disableTouch ) {\n\t\t\teventType(this.wrapper, 'touchstart', this);\n\t\t\teventType(target, 'touchmove', this);\n\t\t\teventType(target, 'touchcancel', this);\n\t\t\teventType(target, 'touchend', this);\n\t\t}\n\n\t\teventType(this.scroller, 'transitionend', this);\n\t\teventType(this.scroller, 'webkitTransitionEnd', this);\n\t\teventType(this.scroller, 'oTransitionEnd', this);\n\t\teventType(this.scroller, 'MSTransitionEnd', this);\n\t},\n\n\tgetComputedPosition: function () {\n\t\tvar matrix = window.getComputedStyle(this.scroller, null),\n\t\t\tx, y;\n\n\t\tif ( this.options.useTransform ) {\n\t\t\tmatrix = matrix[utils.style.transform].split(')')[0].split(', ');\n\t\t\tx = +(matrix[12] || matrix[4]);\n\t\t\ty = +(matrix[13] || matrix[5]);\n\t\t} else {\n\t\t\tx = +matrix.left.replace(/[^-\\d.]/g, '');\n\t\t\ty = +matrix.top.replace(/[^-\\d.]/g, '');\n\t\t}\n\n\t\treturn { x: x, y: y };\n\t},\n\t_initWheel: function () {\n\t\tutils.addEvent(this.wrapper, 'wheel', this);\n\t\tutils.addEvent(this.wrapper, 'mousewheel', this);\n\t\tutils.addEvent(this.wrapper, 'DOMMouseScroll', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tclearTimeout(this.wheelTimeout);\n\t\t\tthis.wheelTimeout = null;\n\t\t\tutils.removeEvent(this.wrapper, 'wheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'mousewheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'DOMMouseScroll', this);\n\t\t});\n\t},\n\n\t_wheel: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tvar wheelDeltaX, wheelDeltaY,\n\t\t\tnewX, newY,\n\t\t\tthat = this;\n\n\t\tif ( this.wheelTimeout === undefined ) {\n\t\t\tthat._execEvent('scrollStart');\n\t\t}\n\n\t\t// Execute the scrollEnd event after 400ms the wheel stopped scrolling\n\t\tclearTimeout(this.wheelTimeout);\n\t\tthis.wheelTimeout = setTimeout(function () {\n\t\t\tif(!that.options.snap) {\n\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t}\n\t\t\tthat.wheelTimeout = undefined;\n\t\t}, 400);\n\n\t\tif ( 'deltaX' in e ) {\n\t\t\tif (e.deltaMode === 1) {\n\t\t\t\twheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;\n\t\t\t\twheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;\n\t\t\t} else {\n\t\t\t\twheelDeltaX = -e.deltaX;\n\t\t\t\twheelDeltaY = -e.deltaY;\n\t\t\t}\n\t\t} else if ( 'wheelDeltaX' in e ) {\n\t\t\twheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;\n\t\t\twheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'wheelDelta' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'detail' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\twheelDeltaX *= this.options.invertWheelDirection;\n\t\twheelDeltaY *= this.options.invertWheelDirection;\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\twheelDeltaX = wheelDeltaY;\n\t\t\twheelDeltaY = 0;\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tnewX = this.currentPage.pageX;\n\t\t\tnewY = this.currentPage.pageY;\n\n\t\t\tif ( wheelDeltaX > 0 ) {\n\t\t\t\tnewX--;\n\t\t\t} else if ( wheelDeltaX < 0 ) {\n\t\t\t\tnewX++;\n\t\t\t}\n\n\t\t\tif ( wheelDeltaY > 0 ) {\n\t\t\t\tnewY--;\n\t\t\t} else if ( wheelDeltaY < 0 ) {\n\t\t\t\tnewY++;\n\t\t\t}\n\n\t\t\tthis.goToPage(newX, newY);\n\n\t\t\treturn;\n\t\t}\n\n\t\tnewX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);\n\t\tnewY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);\n\n\t\tthis.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;\n\t\tthis.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n\t\tif ( this.options.probeType > 1 ) {\n\t\t\tthis._execEvent('scroll');\n\t\t}\n\n// INSERT POINT: _wheel\n\t},\n\n\t_initSnap: function () {\n\t\tthis.currentPage = {};\n\n\t\tif ( typeof this.options.snap == 'string' ) {\n\t\t\tthis.options.snap = this.scroller.querySelectorAll(this.options.snap);\n\t\t}\n\n\t\tthis.on('refresh', function () {\n\t\t\tvar i = 0, l,\n\t\t\t\tm = 0, n,\n\t\t\t\tcx, cy,\n\t\t\t\tx = 0, y,\n\t\t\t\tstepX = this.options.snapStepX || this.wrapperWidth,\n\t\t\t\tstepY = this.options.snapStepY || this.wrapperHeight,\n\t\t\t\tel,\n\t\t\t\trect;\n\n\t\t\tthis.pages = [];\n\n\t\t\tif ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.options.snap === true ) {\n\t\t\t\tcx = Math.round( stepX / 2 );\n\t\t\t\tcy = Math.round( stepY / 2 );\n\n\t\t\t\twhile ( x > -this.scrollerWidth ) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile ( y > -this.scrollerHeight ) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tel = this.options.snap;\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\trect = utils.getRect(el[i]);\n\t\t\t\t\tif ( i === 0 || rect.left <= utils.getRect(el[i-1]).left ) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !this.pages[m] ) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( x > this.maxScrollX ) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);\n\n\t\t\t// Update snap threshold if needed\n\t\t\tif ( this.options.snapThreshold % 1 === 0 ) {\n\t\t\t\tthis.snapThresholdX = this.options.snapThreshold;\n\t\t\t\tthis.snapThresholdY = this.options.snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('flick', function () {\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tthis.goToPage(\n\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\ttime\n\t\t\t);\n\t\t});\n\t},\n\n\t_nearestSnap: function (x, y) {\n\t\tif ( !this.pages.length ) {\n\t\t\treturn { x: 0, y: 0, pageX: 0, pageY: 0 };\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this.pages.length,\n\t\t\tm = 0;\n\n\t\t// Check if we exceeded the snap threshold\n\t\tif ( Math.abs(x - this.absStartX) < this.snapThresholdX &&\n\t\t\tMath.abs(y - this.absStartY) < this.snapThresholdY ) {\n\t\t\treturn this.currentPage;\n\t\t}\n\n\t\tif ( x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( x >= this.pages[i][0].cx ) {\n\t\t\t\tx = this.pages[i][0].x;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tl = this.pages[i].length;\n\n\t\tfor ( ; m < l; m++ ) {\n\t\t\tif ( y >= this.pages[0][m].cy ) {\n\t\t\t\ty = this.pages[0][m].y;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( i == this.currentPage.pageX ) {\n\t\t\ti += this.directionX;\n\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t} else if ( i >= this.pages.length ) {\n\t\t\t\ti = this.pages.length - 1;\n\t\t\t}\n\n\t\t\tx = this.pages[i][0].x;\n\t\t}\n\n\t\tif ( m == this.currentPage.pageY ) {\n\t\t\tm += this.directionY;\n\n\t\t\tif ( m < 0 ) {\n\t\t\t\tm = 0;\n\t\t\t} else if ( m >= this.pages[0].length ) {\n\t\t\t\tm = this.pages[0].length - 1;\n\t\t\t}\n\n\t\t\ty = this.pages[0][m].y;\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tpageX: i,\n\t\t\tpageY: m\n\t\t};\n\t},\n\n\tgoToPage: function (x, y, time, easing) {\n\t\teasing = easing || this.options.bounceEasing;\n\n\t\tif ( x >= this.pages.length ) {\n\t\t\tx = this.pages.length - 1;\n\t\t} else if ( x < 0 ) {\n\t\t\tx = 0;\n\t\t}\n\n\t\tif ( y >= this.pages[x].length ) {\n\t\t\ty = this.pages[x].length - 1;\n\t\t} else if ( y < 0 ) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tvar posX = this.pages[x][y].x,\n\t\t\tposY = this.pages[x][y].y;\n\n\t\ttime = time === undefined ? this.options.snapSpeed || Math.max(\n\t\t\tMath.max(\n\t\t\t\tMath.min(Math.abs(posX - this.x), 1000),\n\t\t\t\tMath.min(Math.abs(posY - this.y), 1000)\n\t\t\t), 300) : time;\n\n\t\tthis.currentPage = {\n\t\t\tx: posX,\n\t\t\ty: posY,\n\t\t\tpageX: x,\n\t\t\tpageY: y\n\t\t};\n\n\t\tthis.scrollTo(posX, posY, time, easing);\n\t},\n\n\tnext: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx++;\n\n\t\tif ( x >= this.pages.length && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty++;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\tprev: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx--;\n\n\t\tif ( x < 0 && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty--;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\t_initKeys: function (e) {\n\t\t// default key bindings\n\t\tvar keys = {\n\t\t\tpageUp: 33,\n\t\t\tpageDown: 34,\n\t\t\tend: 35,\n\t\t\thome: 36,\n\t\t\tleft: 37,\n\t\t\tup: 38,\n\t\t\tright: 39,\n\t\t\tdown: 40\n\t\t};\n\t\tvar i;\n\n\t\t// if you give me characters I give you keycode\n\t\tif ( typeof this.options.keyBindings == 'object' ) {\n\t\t\tfor ( i in this.options.keyBindings ) {\n\t\t\t\tif ( typeof this.options.keyBindings[i] == 'string' ) {\n\t\t\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.options.keyBindings = {};\n\t\t}\n\n\t\tfor ( i in keys ) {\n\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];\n\t\t}\n\n\t\tutils.addEvent(window, 'keydown', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tutils.removeEvent(window, 'keydown', this);\n\t\t});\n\t},\n\n\t_key: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar snap = this.options.snap,\t// we are using this alot, better to cache it\n\t\t\tnewX = snap ? this.currentPage.pageX : this.x,\n\t\t\tnewY = snap ? this.currentPage.pageY : this.y,\n\t\t\tnow = utils.getTime(),\n\t\t\tprevTime = this.keyTime || 0,\n\t\t\tacceleration = 0.250,\n\t\t\tpos;\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tpos = this.getComputedPosition();\n\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis.isInTransition = false;\n\t\t}\n\n\t\tthis.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;\n\n\t\tswitch ( e.keyCode ) {\n\t\t\tcase this.options.keyBindings.pageUp:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX += snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY += snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.pageDown:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX -= snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY -= snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.end:\n\t\t\t\tnewX = snap ? this.pages.length-1 : this.maxScrollX;\n\t\t\t\tnewY = snap ? this.pages[0].length-1 : this.maxScrollY;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.home:\n\t\t\t\tnewX = 0;\n\t\t\t\tnewY = 0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.left:\n\t\t\t\tnewX += snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.up:\n\t\t\t\tnewY += snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.right:\n\t\t\t\tnewX -= snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.down:\n\t\t\t\tnewY -= snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ( snap ) {\n\t\t\tthis.goToPage(newX, newY);\n\t\t\treturn;\n\t\t}\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n\t\tthis.keyTime = now;\n\t},\n\n\t_animate: function (destX, destY, duration, easingFn) {\n\t\tvar that = this,\n\t\t\tstartX = this.x,\n\t\t\tstartY = this.y,\n\t\t\tstartTime = utils.getTime(),\n\t\t\tdestTime = startTime + duration;\n\n\t\tfunction step () {\n\t\t\tvar now = utils.getTime(),\n\t\t\t\tnewX, newY,\n\t\t\t\teasing;\n\n\t\t\tif ( now >= destTime ) {\n\t\t\t\tthat.isAnimating = false;\n\t\t\t\tthat._translate(destX, destY);\n\t\t\t\t\n\t\t\t\tif ( !that.resetPosition(that.options.bounceTime) ) {\n\t\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnow = ( now - startTime ) / duration;\n\t\t\teasing = easingFn(now);\n\t\t\tnewX = ( destX - startX ) * easing + startX;\n\t\t\tnewY = ( destY - startY ) * easing + startY;\n\t\t\tthat._translate(newX, newY);\n\n\t\t\tif ( that.isAnimating ) {\n\t\t\t\trAF(step);\n\t\t\t}\n\n\t\t\tif ( that.options.probeType == 3 ) {\n\t\t\t\tthat._execEvent('scroll');\n\t\t\t}\n\t\t}\n\n\t\tthis.isAnimating = true;\n\t\tstep();\n\t},\n\n\t_initInfinite: function () {\n\t\tvar el = this.options.infiniteElements;\n\n\t\tthis.infiniteElements = typeof el == 'string' ? document.querySelectorAll(el) : el;\n\t\tthis.infiniteLength = this.infiniteElements.length;\n\t\tthis.infiniteMaster = this.infiniteElements[0];\n\t\tthis.infiniteElementHeight = utils.getRect(this.infiniteMaster).height;\n\t\tthis.infiniteHeight = this.infiniteLength * this.infiniteElementHeight;\n\n\t\tthis.options.cacheSize = this.options.cacheSize || 1000;\n\t\tthis.infiniteCacheBuffer = Math.round(this.options.cacheSize / 4);\n\n\t\t//this.infiniteCache = {};\n\t\tthis.options.dataset.call(this, 0, this.options.cacheSize);\n\n\t\tthis.on('refresh', function () {\n\t\t\tvar elementsPerPage = Math.ceil(this.wrapperHeight / this.infiniteElementHeight);\n\t\t\tthis.infiniteUpperBufferSize = Math.floor((this.infiniteLength - elementsPerPage) / 2);\n\t\t\tthis.reorderInfinite();\n\t\t});\n\n\t\tthis.on('scroll', this.reorderInfinite);\n\t},\n\n\t// TO-DO: clean up the mess\n\treorderInfinite: function () {\n\t\tvar center = -this.y + this.wrapperHeight / 2;\n\n\t\tvar minorPhase = Math.max(Math.floor(-this.y / this.infiniteElementHeight) - this.infiniteUpperBufferSize, 0),\n\t\t\tmajorPhase = Math.floor(minorPhase / this.infiniteLength),\n\t\t\tphase = minorPhase - majorPhase * this.infiniteLength;\n\n\t\tvar top = 0;\n\t\tvar i = 0;\n\t\tvar update = [];\n\n\t\t//var cachePhase = Math.floor((minorPhase + this.infiniteLength / 2) / this.infiniteCacheBuffer);\n\t\tvar cachePhase = Math.floor(minorPhase / this.infiniteCacheBuffer);\n\n\t\twhile ( i < this.infiniteLength ) {\n\t\t\ttop = i * this.infiniteElementHeight + majorPhase * this.infiniteHeight;\n\n\t\t\tif ( phase > i ) {\n\t\t\t\ttop += this.infiniteElementHeight * this.infiniteLength;\n\t\t\t}\n\n\t\t\tif ( this.infiniteElements[i]._top !== top ) {\n\t\t\t\tthis.infiniteElements[i]._phase = top / this.infiniteElementHeight;\n\n\t\t\t\tif ( this.infiniteElements[i]._phase < this.options.infiniteLimit ) {\n\t\t\t\t\tthis.infiniteElements[i]._top = top;\n\t\t\t\t\tif ( this.options.infiniteUseTransform ) {\n\t\t\t\t\t\tthis.infiniteElements[i].style[utils.style.transform] = 'translate(0, ' + top + 'px)' + this.translateZ;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.infiniteElements[i].style.top = top + 'px';\n\t\t\t\t\t}\n\t\t\t\t\tupdate.push(this.infiniteElements[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\n\t\tif ( this.cachePhase != cachePhase && (cachePhase === 0 || minorPhase - this.infiniteCacheBuffer > 0) ) {\n\t\t\tthis.options.dataset.call(this, Math.max(cachePhase * this.infiniteCacheBuffer - this.infiniteCacheBuffer, 0), this.options.cacheSize);\n\t\t}\n\n\t\tthis.cachePhase = cachePhase;\n\n\t\tthis.updateContent(update);\n\t},\n\n\tupdateContent: function (els) {\n\t\tif ( this.infiniteCache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( var i = 0, l = els.length; i < l; i++ ) {\n\t\t\tthis.options.dataFiller.call(this, els[i], this.infiniteCache[els[i]._phase]);\n\t\t}\n\t},\n\n\tupdateCache: function (start, data) {\n\t\tvar firstRun = this.infiniteCache === undefined;\n\n\t\tthis.infiniteCache = {};\n\n\t\tfor ( var i = 0, l = data.length; i < l; i++ ) {\n\t\t\tthis.infiniteCache[start++] = data[i];\n\t\t}\n\n\t\tif ( firstRun ) {\n\t\t\tthis.updateContent(this.infiniteElements);\n\t\t}\n\n\t},\n\n\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t\tcase 'orientationchange':\n\t\t\tcase 'resize':\n\t\t\t\tthis._resize();\n\t\t\t\tbreak;\n\t\t\tcase 'transitionend':\n\t\t\tcase 'webkitTransitionEnd':\n\t\t\tcase 'oTransitionEnd':\n\t\t\tcase 'MSTransitionEnd':\n\t\t\t\tthis._transitionEnd(e);\n\t\t\t\tbreak;\n\t\t\tcase 'wheel':\n\t\t\tcase 'DOMMouseScroll':\n\t\t\tcase 'mousewheel':\n\t\t\t\tthis._wheel(e);\n\t\t\t\tbreak;\n\t\t\tcase 'keydown':\n\t\t\t\tthis._key(e);\n\t\t\t\tbreak;\n\t\t\tcase 'click':\n\t\t\t\tif ( this.enabled && !e._constructed ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n};\nIScroll.utils = utils;\n\nif ( typeof module != 'undefined' && module.exports ) {\n\tmodule.exports = IScroll;\n} else if ( typeof define == 'function' && define.amd ) {\n        define( function () { return IScroll; } );\n} else {\n\twindow.IScroll = IScroll;\n}\n\n})(window, document, Math);\n"
  },
  {
    "path": "build/iscroll-lite.js",
    "content": "/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */\n(function (window, document, Math) {\nvar rAF = window.requestAnimationFrame\t||\n\twindow.webkitRequestAnimationFrame\t||\n\twindow.mozRequestAnimationFrame\t\t||\n\twindow.oRequestAnimationFrame\t\t||\n\twindow.msRequestAnimationFrame\t\t||\n\tfunction (callback) { window.setTimeout(callback, 1000 / 60); };\n\nvar utils = (function () {\n\tvar me = {};\n\n\tvar _elementStyle = document.createElement('div').style;\n\tvar _vendor = (function () {\n\t\tvar vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],\n\t\t\ttransform,\n\t\t\ti = 0,\n\t\t\tl = vendors.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\ttransform = vendors[i] + 'ransform';\n\t\t\tif ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);\n\t\t}\n\n\t\treturn false;\n\t})();\n\n\tfunction _prefixStyle (style) {\n\t\tif ( _vendor === false ) return false;\n\t\tif ( _vendor === '' ) return style;\n\t\treturn _vendor + style.charAt(0).toUpperCase() + style.substr(1);\n\t}\n\n\tme.getTime = Date.now || function getTime () { return new Date().getTime(); };\n\n\tme.extend = function (target, obj) {\n\t\tfor ( var i in obj ) {\n\t\t\ttarget[i] = obj[i];\n\t\t}\n\t};\n\n\tme.addEvent = function (el, type, fn, capture) {\n\t\tel.addEventListener(type, fn, !!capture);\n\t};\n\n\tme.removeEvent = function (el, type, fn, capture) {\n\t\tel.removeEventListener(type, fn, !!capture);\n\t};\n\n\tme.prefixPointerEvent = function (pointerEvent) {\n\t\treturn window.MSPointerEvent ?\n\t\t\t'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):\n\t\t\tpointerEvent;\n\t};\n\n\tme.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {\n\t\tvar distance = current - start,\n\t\t\tspeed = Math.abs(distance) / time,\n\t\t\tdestination,\n\t\t\tduration;\n\n\t\tdeceleration = deceleration === undefined ? 0.0006 : deceleration;\n\n\t\tdestination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\n\t\tduration = speed / deceleration;\n\n\t\tif ( destination < lowerMargin ) {\n\t\t\tdestination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\n\t\t\tdistance = Math.abs(destination - current);\n\t\t\tduration = distance / speed;\n\t\t} else if ( destination > 0 ) {\n\t\t\tdestination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\n\t\t\tdistance = Math.abs(current) + destination;\n\t\t\tduration = distance / speed;\n\t\t}\n\n\t\treturn {\n\t\t\tdestination: Math.round(destination),\n\t\t\tduration: duration\n\t\t};\n\t};\n\n\tvar _transform = _prefixStyle('transform');\n\n\tme.extend(me, {\n\t\thasTransform: _transform !== false,\n\t\thasPerspective: _prefixStyle('perspective') in _elementStyle,\n\t\thasTouch: 'ontouchstart' in window,\n\t\thasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed\n\t\thasTransition: _prefixStyle('transition') in _elementStyle\n\t});\n\n\t/*\n\tThis should find all Android browsers lower than build 535.19 (both stock browser and webview)\n\t- galaxy S2 is ok\n    - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`\n    - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S3 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S4 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S5 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n   - galaxy S6 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n  */\n\tme.isBadAndroid = (function() {\n\t\tvar appVersion = window.navigator.appVersion;\n\t\t// Android browser is not a chrome browser.\n\t\tif (/Android/.test(appVersion) && !(/Chrome\\/\\d/.test(appVersion))) {\n\t\t\tvar safariVersion = appVersion.match(/Safari\\/(\\d+.\\d)/);\n\t\t\tif(safariVersion && typeof safariVersion === \"object\" && safariVersion.length >= 2) {\n\t\t\t\treturn parseFloat(safariVersion[1]) < 535.19;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\tme.extend(me.style = {}, {\n\t\ttransform: _transform,\n\t\ttransitionTimingFunction: _prefixStyle('transitionTimingFunction'),\n\t\ttransitionDuration: _prefixStyle('transitionDuration'),\n\t\ttransitionDelay: _prefixStyle('transitionDelay'),\n\t\ttransformOrigin: _prefixStyle('transformOrigin'),\n\t\ttouchAction: _prefixStyle('touchAction')\n\t});\n\n\tme.hasClass = function (e, c) {\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\");\n\t\treturn re.test(e.className);\n\t};\n\n\tme.addClass = function (e, c) {\n\t\tif ( me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar newclass = e.className.split(' ');\n\t\tnewclass.push(c);\n\t\te.className = newclass.join(' ');\n\t};\n\n\tme.removeClass = function (e, c) {\n\t\tif ( !me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\", 'g');\n\t\te.className = e.className.replace(re, ' ');\n\t};\n\n\tme.offset = function (el) {\n\t\tvar left = -el.offsetLeft,\n\t\t\ttop = -el.offsetTop;\n\n\t\t// jshint -W084\n\t\twhile (el = el.offsetParent) {\n\t\t\tleft -= el.offsetLeft;\n\t\t\ttop -= el.offsetTop;\n\t\t}\n\t\t// jshint +W084\n\n\t\treturn {\n\t\t\tleft: left,\n\t\t\ttop: top\n\t\t};\n\t};\n\n\tme.preventDefaultException = function (el, exceptions) {\n\t\tfor ( var i in exceptions ) {\n\t\t\tif ( exceptions[i].test(el[i]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tme.extend(me.eventType = {}, {\n\t\ttouchstart: 1,\n\t\ttouchmove: 1,\n\t\ttouchend: 1,\n\n\t\tmousedown: 2,\n\t\tmousemove: 2,\n\t\tmouseup: 2,\n\n\t\tpointerdown: 3,\n\t\tpointermove: 3,\n\t\tpointerup: 3,\n\n\t\tMSPointerDown: 3,\n\t\tMSPointerMove: 3,\n\t\tMSPointerUp: 3\n\t});\n\n\tme.extend(me.ease = {}, {\n\t\tquadratic: {\n\t\t\tstyle: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n\t\t\tfn: function (k) {\n\t\t\t\treturn k * ( 2 - k );\n\t\t\t}\n\t\t},\n\t\tcircular: {\n\t\t\tstyle: 'cubic-bezier(0.1, 0.57, 0.1, 1)',\t// Not properly \"circular\" but this looks better, it should be (0.075, 0.82, 0.165, 1)\n\t\t\tfn: function (k) {\n\t\t\t\treturn Math.sqrt( 1 - ( --k * k ) );\n\t\t\t}\n\t\t},\n\t\tback: {\n\t\t\tstyle: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n\t\t\tfn: function (k) {\n\t\t\t\tvar b = 4;\n\t\t\t\treturn ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;\n\t\t\t}\n\t\t},\n\t\tbounce: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tif ( ( k /= 1 ) < ( 1 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * k * k;\n\t\t\t\t} else if ( k < ( 2 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n\t\t\t\t} else if ( k < ( 2.5 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n\t\t\t\t} else {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\telastic: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tvar f = 0.22,\n\t\t\t\t\te = 0.4;\n\n\t\t\t\tif ( k === 0 ) { return 0; }\n\t\t\t\tif ( k == 1 ) { return 1; }\n\n\t\t\t\treturn ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );\n\t\t\t}\n\t\t}\n\t});\n\n\tme.tap = function (e, eventName) {\n\t\tvar ev = document.createEvent('Event');\n\t\tev.initEvent(eventName, true, true);\n\t\tev.pageX = e.pageX;\n\t\tev.pageY = e.pageY;\n\t\te.target.dispatchEvent(ev);\n\t};\n\n\tme.click = function (e) {\n\t\tvar target = e.target,\n\t\t\tev;\n\n\t\tif ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n\t\t\t// initMouseEvent is deprecated.\n\t\t\tev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');\n\t\t\tev.initEvent('click', true, true);\n\t\t\tev.view = e.view || window;\n\t\t\tev.detail = 1;\n\t\t\tev.screenX = target.screenX || 0;\n\t\t\tev.screenY = target.screenY || 0;\n\t\t\tev.clientX = target.clientX || 0;\n\t\t\tev.clientY = target.clientY || 0;\n\t\t\tev.ctrlKey = !!e.ctrlKey;\n\t\t\tev.altKey = !!e.altKey;\n\t\t\tev.shiftKey = !!e.shiftKey;\n\t\t\tev.metaKey = !!e.metaKey;\n\t\t\tev.button = 0;\n\t\t\tev.relatedTarget = null;\n\t\t\tev._constructed = true;\n\t\t\ttarget.dispatchEvent(ev);\n\t\t}\n\t};\n\n\tme.getTouchAction = function(eventPassthrough, addPinch) {\n\t\tvar touchAction = 'none';\n\t\tif ( eventPassthrough === 'vertical' ) {\n\t\t\ttouchAction = 'pan-y';\n\t\t} else if (eventPassthrough === 'horizontal' ) {\n\t\t\ttouchAction = 'pan-x';\n\t\t}\n\t\tif (addPinch && touchAction != 'none') {\n\t\t\t// add pinch-zoom support if the browser supports it, but if not (eg. Chrome <55) do nothing\n\t\t\ttouchAction += ' pinch-zoom';\n\t\t}\n\t\treturn touchAction;\n\t};\n\n\tme.getRect = function(el) {\n\t\tif (el instanceof SVGElement) {\n\t\t\tvar rect = el.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop : rect.top,\n\t\t\t\tleft : rect.left,\n\t\t\t\twidth : rect.width,\n\t\t\t\theight : rect.height\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttop : el.offsetTop,\n\t\t\t\tleft : el.offsetLeft,\n\t\t\t\twidth : el.offsetWidth,\n\t\t\t\theight : el.offsetHeight\n\t\t\t};\n\t\t}\n\t};\n\n\treturn me;\n})();\nfunction IScroll (el, options) {\n\tthis.wrapper = typeof el == 'string' ? document.querySelector(el) : el;\n\tthis.scroller = this.wrapper.children[0];\n\tthis.scrollerStyle = this.scroller.style;\t\t// cache style for better performance\n\n\tthis.options = {\n\n// INSERT POINT: OPTIONS\n\t\tdisablePointer : !utils.hasPointer,\n\t\tdisableTouch : utils.hasPointer || !utils.hasTouch,\n\t\tdisableMouse : utils.hasPointer || utils.hasTouch,\n\t\tstartX: 0,\n\t\tstartY: 0,\n\t\tscrollY: true,\n\t\tdirectionLockThreshold: 5,\n\t\tmomentum: true,\n\n\t\tbounce: true,\n\t\tbounceTime: 600,\n\t\tbounceEasing: '',\n\n\t\tpreventDefault: true,\n\t\tpreventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },\n\n\t\tHWCompositing: true,\n\t\tuseTransition: true,\n\t\tuseTransform: true,\n\t\tbindToWrapper: typeof window.onmousedown === \"undefined\"\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\t// Normalize options\n\tthis.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';\n\n\tthis.options.useTransition = utils.hasTransition && this.options.useTransition;\n\tthis.options.useTransform = utils.hasTransform && this.options.useTransform;\n\n\tthis.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;\n\tthis.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;\n\n\t// If you want eventPassthrough I have to lock one of the axes\n\tthis.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;\n\tthis.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;\n\n\t// With eventPassthrough we also need lockDirection mechanism\n\tthis.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;\n\tthis.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;\n\n\tthis.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;\n\n\tthis.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;\n\n\tif ( this.options.tap === true ) {\n\t\tthis.options.tap = 'tap';\n\t}\n\n\t// https://github.com/cubiq/iscroll/issues/1029\n\tif (!this.options.useTransition && !this.options.useTransform) {\n\t\tif(!(/relative|absolute/i).test(this.scrollerStyle.position)) {\n\t\t\tthis.scrollerStyle.position = \"relative\";\n\t\t}\n\t}\n\n// INSERT POINT: NORMALIZATION\n\n\t// Some defaults\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.directionX = 0;\n\tthis.directionY = 0;\n\tthis._events = {};\n\n// INSERT POINT: DEFAULTS\n\n\tthis._init();\n\tthis.refresh();\n\n\tthis.scrollTo(this.options.startX, this.options.startY);\n\tthis.enable();\n}\n\nIScroll.prototype = {\n\tversion: '5.2.0-snapshot',\n\n\t_init: function () {\n\t\tthis._initEvents();\n\n// INSERT POINT: _init\n\n\t},\n\n\tdestroy: function () {\n\t\tthis._initEvents(true);\n\t\tclearTimeout(this.resizeTimeout);\n \t\tthis.resizeTimeout = null;\n\t\tthis._execEvent('destroy');\n\t},\n\n\t_transitionEnd: function (e) {\n\t\tif ( e.target != this.scroller || !this.isInTransition ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._transitionTime();\n\t\tif ( !this.resetPosition(this.options.bounceTime) ) {\n\t\t\tthis.isInTransition = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\t// React to left mouse button only\n\t\tif ( utils.eventType[e.type] != 1 ) {\n\t\t  // for button property\n\t\t  // http://unixpapa.com/js/mouse.html\n\t\t  var button;\n\t    if (!e.which) {\n\t      /* IE case */\n\t      button = (e.button < 2) ? 0 :\n\t               ((e.button == 4) ? 1 : 2);\n\t    } else {\n\t      /* All others */\n\t      button = e.button;\n\t    }\n\t\t\tif ( button !== 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tpos;\n\n\t\tthis.initiated\t= utils.eventType[e.type];\n\t\tthis.moved\t\t= false;\n\t\tthis.distX\t\t= 0;\n\t\tthis.distY\t\t= 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\tthis.directionLocked = 0;\n\n\t\tthis.startTime = utils.getTime();\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tthis._transitionTime();\n\t\t\tthis.isInTransition = false;\n\t\t\tpos = this.getComputedPosition();\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis._execEvent('scrollEnd');\n\t\t} else if ( !this.options.useTransition && this.isAnimating ) {\n\t\t\tthis.isAnimating = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\n\t\tthis.startX    = this.x;\n\t\tthis.startY    = this.y;\n\t\tthis.absStartX = this.x;\n\t\tthis.absStartY = this.y;\n\t\tthis.pointX    = point.pageX;\n\t\tthis.pointY    = point.pageY;\n\n\t\tthis._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\t// increases performance on Android? TODO: check!\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point\t\t= e.touches ? e.touches[0] : e,\n\t\t\tdeltaX\t\t= point.pageX - this.pointX,\n\t\t\tdeltaY\t\t= point.pageY - this.pointY,\n\t\t\ttimestamp\t= utils.getTime(),\n\t\t\tnewX, newY,\n\t\t\tabsDistX, absDistY;\n\n\t\tthis.pointX\t\t= point.pageX;\n\t\tthis.pointY\t\t= point.pageY;\n\n\t\tthis.distX\t\t+= deltaX;\n\t\tthis.distY\t\t+= deltaY;\n\t\tabsDistX\t\t= Math.abs(this.distX);\n\t\tabsDistY\t\t= Math.abs(this.distY);\n\n\t\t// We need to move at least 10 pixels for the scrolling to initiate\n\t\tif ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If you are scrolling in one direction lock the other\n\t\tif ( !this.directionLocked && !this.options.freeScroll ) {\n\t\t\tif ( absDistX > absDistY + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'h';\t\t// lock horizontally\n\t\t\t} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'v';\t\t// lock vertically\n\t\t\t} else {\n\t\t\t\tthis.directionLocked = 'n';\t\t// no lock\n\t\t\t}\n\t\t}\n\n\t\tif ( this.directionLocked == 'h' ) {\n\t\t\tif ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaY = 0;\n\t\t} else if ( this.directionLocked == 'v' ) {\n\t\t\tif ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaX = 0;\n\t\t}\n\n\t\tdeltaX = this.hasHorizontalScroll ? deltaX : 0;\n\t\tdeltaY = this.hasVerticalScroll ? deltaY : 0;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\t// Slow down if outside of the boundaries\n\t\tif ( newX > 0 || newX < this.maxScrollX ) {\n\t\t\tnewX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;\n\t\t}\n\t\tif ( newY > 0 || newY < this.maxScrollY ) {\n\t\t\tnewY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;\n\t\t}\n\n\t\tthis.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;\n\t\tthis.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;\n\n\t\tif ( !this.moved ) {\n\t\t\tthis._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tthis._translate(newX, newY);\n\n/* REPLACE START: _move */\n\n\t\tif ( timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.startX = this.x;\n\t\t\tthis.startY = this.y;\n\t\t}\n\n/* REPLACE END: _move */\n\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.changedTouches ? e.changedTouches[0] : e,\n\t\t\tmomentumX,\n\t\t\tmomentumY,\n\t\t\tduration = utils.getTime() - this.startTime,\n\t\t\tnewX = Math.round(this.x),\n\t\t\tnewY = Math.round(this.y),\n\t\t\tdistanceX = Math.abs(newX - this.startX),\n\t\t\tdistanceY = Math.abs(newY - this.startY),\n\t\t\ttime = 0,\n\t\t\teasing = '';\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\t\tthis.endTime = utils.getTime();\n\n\t\t// reset if we are outside of the boundaries\n\t\tif ( this.resetPosition(this.options.bounceTime) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY);\t// ensures that the last position is rounded\n\n\t\t// we scrolled less than 10 pixels\n\t\tif ( !this.moved ) {\n\t\t\tif ( this.options.tap ) {\n\t\t\t\tutils.tap(e, this.options.tap);\n\t\t\t}\n\n\t\t\tif ( this.options.click ) {\n\t\t\t\tutils.click(e);\n\t\t\t}\n\n\t\t\tthis._execEvent('scrollCancel');\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {\n\t\t\tthis._execEvent('flick');\n\t\t\treturn;\n\t\t}\n\n\t\t// start momentum animation if needed\n\t\tif ( this.options.momentum && duration < 300 ) {\n\t\t\tmomentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };\n\t\t\tmomentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };\n\t\t\tnewX = momentumX.destination;\n\t\t\tnewY = momentumY.destination;\n\t\t\ttime = Math.max(momentumX.duration, momentumY.duration);\n\t\t\tthis.isInTransition = 1;\n\t\t}\n\n// INSERT POINT: _end\n\n\t\tif ( newX != this.x || newY != this.y ) {\n\t\t\t// change easing function when scroller goes out of the boundaries\n\t\t\tif ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {\n\t\t\t\teasing = utils.ease.quadratic;\n\t\t\t}\n\n\t\t\tthis.scrollTo(newX, newY, time, easing);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._execEvent('scrollEnd');\n\t},\n\n\t_resize: function () {\n\t\tvar that = this;\n\n\t\tclearTimeout(this.resizeTimeout);\n\n\t\tthis.resizeTimeout = setTimeout(function () {\n\t\t\tthat.refresh();\n\t\t}, this.options.resizePolling);\n\t},\n\n\tresetPosition: function (time) {\n\t\tvar x = this.x,\n\t\t\ty = this.y;\n\n\t\ttime = time || 0;\n\n\t\tif ( !this.hasHorizontalScroll || this.x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( this.x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll || this.y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( this.y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tif ( x == this.x && y == this.y ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time, this.options.bounceEasing);\n\n\t\treturn true;\n\t},\n\n\tdisable: function () {\n\t\tthis.enabled = false;\n\t},\n\n\tenable: function () {\n\t\tthis.enabled = true;\n\t},\n\n\trefresh: function () {\n\t\tutils.getRect(this.wrapper);\t\t// Force reflow\n\n\t\tthis.wrapperWidth\t= this.wrapper.clientWidth;\n\t\tthis.wrapperHeight\t= this.wrapper.clientHeight;\n\n\t\tvar rect = utils.getRect(this.scroller);\n/* REPLACE START: refresh */\n\n\t\tthis.scrollerWidth\t= rect.width;\n\t\tthis.scrollerHeight\t= rect.height;\n\n\t\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\t\tthis.maxScrollY\t\t= this.wrapperHeight - this.scrollerHeight;\n\n/* REPLACE END: refresh */\n\n\t\tthis.hasHorizontalScroll\t= this.options.scrollX && this.maxScrollX < 0;\n\t\tthis.hasVerticalScroll\t\t= this.options.scrollY && this.maxScrollY < 0;\n\t\t\n\t\tif ( !this.hasHorizontalScroll ) {\n\t\t\tthis.maxScrollX = 0;\n\t\t\tthis.scrollerWidth = this.wrapperWidth;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\tthis.maxScrollY = 0;\n\t\t\tthis.scrollerHeight = this.wrapperHeight;\n\t\t}\n\n\t\tthis.endTime = 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\t\n\t\tif(utils.hasPointer && !this.options.disablePointer) {\n\t\t\t// The wrapper should have `touchAction` property for using pointerEvent.\n\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, true);\n\n\t\t\t// case. not support 'pinch-zoom'\n\t\t\t// https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583\n\t\t\tif (!this.wrapper.style[utils.style.touchAction]) {\n\t\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, false);\n\t\t\t}\n\t\t}\n\t\tthis.wrapperOffset = utils.offset(this.wrapper);\n\n\t\tthis._execEvent('refresh');\n\n\t\tthis.resetPosition();\n\n// INSERT POINT: _refresh\n\n\t},\t\n\n\ton: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\tthis._events[type] = [];\n\t\t}\n\n\t\tthis._events[type].push(fn);\n\t},\n\n\toff: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar index = this._events[type].indexOf(fn);\n\n\t\tif ( index > -1 ) {\n\t\t\tthis._events[type].splice(index, 1);\n\t\t}\n\t},\n\n\t_execEvent: function (type) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this._events[type].length;\n\n\t\tif ( !l ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tthis._events[type][i].apply(this, [].slice.call(arguments, 1));\n\t\t}\n\t},\n\n\tscrollBy: function (x, y, time, easing) {\n\t\tx = this.x + x;\n\t\ty = this.y + y;\n\t\ttime = time || 0;\n\n\t\tthis.scrollTo(x, y, time, easing);\n\t},\n\n\tscrollTo: function (x, y, time, easing) {\n\t\teasing = easing || utils.ease.circular;\n\n\t\tthis.isInTransition = this.options.useTransition && time > 0;\n\t\tvar transitionType = this.options.useTransition && easing.style;\n\t\tif ( !time || transitionType ) {\n\t\t\t\tif(transitionType) {\n\t\t\t\t\tthis._transitionTimingFunction(easing.style);\n\t\t\t\t\tthis._transitionTime(time);\n\t\t\t\t}\n\t\t\tthis._translate(x, y);\n\t\t} else {\n\t\t\tthis._animate(x, y, time, easing.fn);\n\t\t}\n\t},\n\n\tscrollToElement: function (el, time, offsetX, offsetY, easing) {\n\t\tel = el.nodeType ? el : this.scroller.querySelector(el);\n\n\t\tif ( !el ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar pos = utils.offset(el);\n\n\t\tpos.left -= this.wrapperOffset.left;\n\t\tpos.top  -= this.wrapperOffset.top;\n\n\t\t// if offsetX/Y are true we center the element to the screen\n\t\tvar elRect = utils.getRect(el);\n\t\tvar wrapperRect = utils.getRect(this.wrapper);\n\t\tif ( offsetX === true ) {\n\t\t\toffsetX = Math.round(elRect.width / 2 - wrapperRect.width / 2);\n\t\t}\n\t\tif ( offsetY === true ) {\n\t\t\toffsetY = Math.round(elRect.height / 2 - wrapperRect.height / 2);\n\t\t}\n\n\t\tpos.left -= offsetX || 0;\n\t\tpos.top  -= offsetY || 0;\n\n\t\tpos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;\n\t\tpos.top  = pos.top  > 0 ? 0 : pos.top  < this.maxScrollY ? this.maxScrollY : pos.top;\n\n\t\ttime = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;\n\n\t\tthis.scrollTo(pos.left, pos.top, time, easing);\n\t},\n\n\t_transitionTime: function (time) {\n\t\tif (!this.options.useTransition) {\n\t\t\treturn;\n\t\t}\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollerStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.scrollerStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.scrollerStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.scrollerStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n// INSERT POINT: _transitionTime\n\n\t},\n\n\t_transitionTimingFunction: function (easing) {\n\t\tthis.scrollerStyle[utils.style.transitionTimingFunction] = easing;\n\n// INSERT POINT: _transitionTimingFunction\n\n\t},\n\n\t_translate: function (x, y) {\n\t\tif ( this.options.useTransform ) {\n\n/* REPLACE START: _translate */\n\n\t\t\tthis.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;\n\n/* REPLACE END: _translate */\n\n\t\t} else {\n\t\t\tx = Math.round(x);\n\t\t\ty = Math.round(y);\n\t\t\tthis.scrollerStyle.left = x + 'px';\n\t\t\tthis.scrollerStyle.top = y + 'px';\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n// INSERT POINT: _translate\n\n\t},\n\n\t_initEvents: function (remove) {\n\t\tvar eventType = remove ? utils.removeEvent : utils.addEvent,\n\t\t\ttarget = this.options.bindToWrapper ? this.wrapper : window;\n\n\t\teventType(window, 'orientationchange', this);\n\t\teventType(window, 'resize', this);\n\n\t\tif ( this.options.click ) {\n\t\t\teventType(this.wrapper, 'click', this, true);\n\t\t}\n\n\t\tif ( !this.options.disableMouse ) {\n\t\t\teventType(this.wrapper, 'mousedown', this);\n\t\t\teventType(target, 'mousemove', this);\n\t\t\teventType(target, 'mousecancel', this);\n\t\t\teventType(target, 'mouseup', this);\n\t\t}\n\n\t\tif ( utils.hasPointer && !this.options.disablePointer ) {\n\t\t\teventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointermove'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointercancel'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\n\t\tif ( utils.hasTouch && !this.options.disableTouch ) {\n\t\t\teventType(this.wrapper, 'touchstart', this);\n\t\t\teventType(target, 'touchmove', this);\n\t\t\teventType(target, 'touchcancel', this);\n\t\t\teventType(target, 'touchend', this);\n\t\t}\n\n\t\teventType(this.scroller, 'transitionend', this);\n\t\teventType(this.scroller, 'webkitTransitionEnd', this);\n\t\teventType(this.scroller, 'oTransitionEnd', this);\n\t\teventType(this.scroller, 'MSTransitionEnd', this);\n\t},\n\n\tgetComputedPosition: function () {\n\t\tvar matrix = window.getComputedStyle(this.scroller, null),\n\t\t\tx, y;\n\n\t\tif ( this.options.useTransform ) {\n\t\t\tmatrix = matrix[utils.style.transform].split(')')[0].split(', ');\n\t\t\tx = +(matrix[12] || matrix[4]);\n\t\t\ty = +(matrix[13] || matrix[5]);\n\t\t} else {\n\t\t\tx = +matrix.left.replace(/[^-\\d.]/g, '');\n\t\t\ty = +matrix.top.replace(/[^-\\d.]/g, '');\n\t\t}\n\n\t\treturn { x: x, y: y };\n\t},\n\t_animate: function (destX, destY, duration, easingFn) {\n\t\tvar that = this,\n\t\t\tstartX = this.x,\n\t\t\tstartY = this.y,\n\t\t\tstartTime = utils.getTime(),\n\t\t\tdestTime = startTime + duration;\n\n\t\tfunction step () {\n\t\t\tvar now = utils.getTime(),\n\t\t\t\tnewX, newY,\n\t\t\t\teasing;\n\n\t\t\tif ( now >= destTime ) {\n\t\t\t\tthat.isAnimating = false;\n\t\t\t\tthat._translate(destX, destY);\n\n\t\t\t\tif ( !that.resetPosition(that.options.bounceTime) ) {\n\t\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnow = ( now - startTime ) / duration;\n\t\t\teasing = easingFn(now);\n\t\t\tnewX = ( destX - startX ) * easing + startX;\n\t\t\tnewY = ( destY - startY ) * easing + startY;\n\t\t\tthat._translate(newX, newY);\n\n\t\t\tif ( that.isAnimating ) {\n\t\t\t\trAF(step);\n\t\t\t}\n\t\t}\n\n\t\tthis.isAnimating = true;\n\t\tstep();\n\t},\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t\tcase 'orientationchange':\n\t\t\tcase 'resize':\n\t\t\t\tthis._resize();\n\t\t\t\tbreak;\n\t\t\tcase 'transitionend':\n\t\t\tcase 'webkitTransitionEnd':\n\t\t\tcase 'oTransitionEnd':\n\t\t\tcase 'MSTransitionEnd':\n\t\t\t\tthis._transitionEnd(e);\n\t\t\t\tbreak;\n\t\t\tcase 'wheel':\n\t\t\tcase 'DOMMouseScroll':\n\t\t\tcase 'mousewheel':\n\t\t\t\tthis._wheel(e);\n\t\t\t\tbreak;\n\t\t\tcase 'keydown':\n\t\t\t\tthis._key(e);\n\t\t\t\tbreak;\n\t\t\tcase 'click':\n\t\t\t\tif ( this.enabled && !e._constructed ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n};\nIScroll.utils = utils;\n\nif ( typeof module != 'undefined' && module.exports ) {\n\tmodule.exports = IScroll;\n} else if ( typeof define == 'function' && define.amd ) {\n        define( function () { return IScroll; } );\n} else {\n\twindow.IScroll = IScroll;\n}\n\n})(window, document, Math);\n"
  },
  {
    "path": "build/iscroll-probe.js",
    "content": "/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */\n(function (window, document, Math) {\nvar rAF = window.requestAnimationFrame\t||\n\twindow.webkitRequestAnimationFrame\t||\n\twindow.mozRequestAnimationFrame\t\t||\n\twindow.oRequestAnimationFrame\t\t||\n\twindow.msRequestAnimationFrame\t\t||\n\tfunction (callback) { window.setTimeout(callback, 1000 / 60); };\n\nvar utils = (function () {\n\tvar me = {};\n\n\tvar _elementStyle = document.createElement('div').style;\n\tvar _vendor = (function () {\n\t\tvar vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],\n\t\t\ttransform,\n\t\t\ti = 0,\n\t\t\tl = vendors.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\ttransform = vendors[i] + 'ransform';\n\t\t\tif ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);\n\t\t}\n\n\t\treturn false;\n\t})();\n\n\tfunction _prefixStyle (style) {\n\t\tif ( _vendor === false ) return false;\n\t\tif ( _vendor === '' ) return style;\n\t\treturn _vendor + style.charAt(0).toUpperCase() + style.substr(1);\n\t}\n\n\tme.getTime = Date.now || function getTime () { return new Date().getTime(); };\n\n\tme.extend = function (target, obj) {\n\t\tfor ( var i in obj ) {\n\t\t\ttarget[i] = obj[i];\n\t\t}\n\t};\n\n\tme.addEvent = function (el, type, fn, capture) {\n\t\tel.addEventListener(type, fn, !!capture);\n\t};\n\n\tme.removeEvent = function (el, type, fn, capture) {\n\t\tel.removeEventListener(type, fn, !!capture);\n\t};\n\n\tme.prefixPointerEvent = function (pointerEvent) {\n\t\treturn window.MSPointerEvent ?\n\t\t\t'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):\n\t\t\tpointerEvent;\n\t};\n\n\tme.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {\n\t\tvar distance = current - start,\n\t\t\tspeed = Math.abs(distance) / time,\n\t\t\tdestination,\n\t\t\tduration;\n\n\t\tdeceleration = deceleration === undefined ? 0.0006 : deceleration;\n\n\t\tdestination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\n\t\tduration = speed / deceleration;\n\n\t\tif ( destination < lowerMargin ) {\n\t\t\tdestination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\n\t\t\tdistance = Math.abs(destination - current);\n\t\t\tduration = distance / speed;\n\t\t} else if ( destination > 0 ) {\n\t\t\tdestination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\n\t\t\tdistance = Math.abs(current) + destination;\n\t\t\tduration = distance / speed;\n\t\t}\n\n\t\treturn {\n\t\t\tdestination: Math.round(destination),\n\t\t\tduration: duration\n\t\t};\n\t};\n\n\tvar _transform = _prefixStyle('transform');\n\n\tme.extend(me, {\n\t\thasTransform: _transform !== false,\n\t\thasPerspective: _prefixStyle('perspective') in _elementStyle,\n\t\thasTouch: 'ontouchstart' in window,\n\t\thasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed\n\t\thasTransition: _prefixStyle('transition') in _elementStyle\n\t});\n\n\t/*\n\tThis should find all Android browsers lower than build 535.19 (both stock browser and webview)\n\t- galaxy S2 is ok\n    - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`\n    - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S3 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S4 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S5 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n   - galaxy S6 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n  */\n\tme.isBadAndroid = (function() {\n\t\tvar appVersion = window.navigator.appVersion;\n\t\t// Android browser is not a chrome browser.\n\t\tif (/Android/.test(appVersion) && !(/Chrome\\/\\d/.test(appVersion))) {\n\t\t\tvar safariVersion = appVersion.match(/Safari\\/(\\d+.\\d)/);\n\t\t\tif(safariVersion && typeof safariVersion === \"object\" && safariVersion.length >= 2) {\n\t\t\t\treturn parseFloat(safariVersion[1]) < 535.19;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\tme.extend(me.style = {}, {\n\t\ttransform: _transform,\n\t\ttransitionTimingFunction: _prefixStyle('transitionTimingFunction'),\n\t\ttransitionDuration: _prefixStyle('transitionDuration'),\n\t\ttransitionDelay: _prefixStyle('transitionDelay'),\n\t\ttransformOrigin: _prefixStyle('transformOrigin'),\n\t\ttouchAction: _prefixStyle('touchAction')\n\t});\n\n\tme.hasClass = function (e, c) {\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\");\n\t\treturn re.test(e.className);\n\t};\n\n\tme.addClass = function (e, c) {\n\t\tif ( me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar newclass = e.className.split(' ');\n\t\tnewclass.push(c);\n\t\te.className = newclass.join(' ');\n\t};\n\n\tme.removeClass = function (e, c) {\n\t\tif ( !me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\", 'g');\n\t\te.className = e.className.replace(re, ' ');\n\t};\n\n\tme.offset = function (el) {\n\t\tvar left = -el.offsetLeft,\n\t\t\ttop = -el.offsetTop;\n\n\t\t// jshint -W084\n\t\twhile (el = el.offsetParent) {\n\t\t\tleft -= el.offsetLeft;\n\t\t\ttop -= el.offsetTop;\n\t\t}\n\t\t// jshint +W084\n\n\t\treturn {\n\t\t\tleft: left,\n\t\t\ttop: top\n\t\t};\n\t};\n\n\tme.preventDefaultException = function (el, exceptions) {\n\t\tfor ( var i in exceptions ) {\n\t\t\tif ( exceptions[i].test(el[i]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tme.extend(me.eventType = {}, {\n\t\ttouchstart: 1,\n\t\ttouchmove: 1,\n\t\ttouchend: 1,\n\n\t\tmousedown: 2,\n\t\tmousemove: 2,\n\t\tmouseup: 2,\n\n\t\tpointerdown: 3,\n\t\tpointermove: 3,\n\t\tpointerup: 3,\n\n\t\tMSPointerDown: 3,\n\t\tMSPointerMove: 3,\n\t\tMSPointerUp: 3\n\t});\n\n\tme.extend(me.ease = {}, {\n\t\tquadratic: {\n\t\t\tstyle: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n\t\t\tfn: function (k) {\n\t\t\t\treturn k * ( 2 - k );\n\t\t\t}\n\t\t},\n\t\tcircular: {\n\t\t\tstyle: 'cubic-bezier(0.1, 0.57, 0.1, 1)',\t// Not properly \"circular\" but this looks better, it should be (0.075, 0.82, 0.165, 1)\n\t\t\tfn: function (k) {\n\t\t\t\treturn Math.sqrt( 1 - ( --k * k ) );\n\t\t\t}\n\t\t},\n\t\tback: {\n\t\t\tstyle: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n\t\t\tfn: function (k) {\n\t\t\t\tvar b = 4;\n\t\t\t\treturn ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;\n\t\t\t}\n\t\t},\n\t\tbounce: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tif ( ( k /= 1 ) < ( 1 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * k * k;\n\t\t\t\t} else if ( k < ( 2 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n\t\t\t\t} else if ( k < ( 2.5 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n\t\t\t\t} else {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\telastic: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tvar f = 0.22,\n\t\t\t\t\te = 0.4;\n\n\t\t\t\tif ( k === 0 ) { return 0; }\n\t\t\t\tif ( k == 1 ) { return 1; }\n\n\t\t\t\treturn ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );\n\t\t\t}\n\t\t}\n\t});\n\n\tme.tap = function (e, eventName) {\n\t\tvar ev = document.createEvent('Event');\n\t\tev.initEvent(eventName, true, true);\n\t\tev.pageX = e.pageX;\n\t\tev.pageY = e.pageY;\n\t\te.target.dispatchEvent(ev);\n\t};\n\n\tme.click = function (e) {\n\t\tvar target = e.target,\n\t\t\tev;\n\n\t\tif ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n\t\t\t// initMouseEvent is deprecated.\n\t\t\tev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');\n\t\t\tev.initEvent('click', true, true);\n\t\t\tev.view = e.view || window;\n\t\t\tev.detail = 1;\n\t\t\tev.screenX = target.screenX || 0;\n\t\t\tev.screenY = target.screenY || 0;\n\t\t\tev.clientX = target.clientX || 0;\n\t\t\tev.clientY = target.clientY || 0;\n\t\t\tev.ctrlKey = !!e.ctrlKey;\n\t\t\tev.altKey = !!e.altKey;\n\t\t\tev.shiftKey = !!e.shiftKey;\n\t\t\tev.metaKey = !!e.metaKey;\n\t\t\tev.button = 0;\n\t\t\tev.relatedTarget = null;\n\t\t\tev._constructed = true;\n\t\t\ttarget.dispatchEvent(ev);\n\t\t}\n\t};\n\n\tme.getTouchAction = function(eventPassthrough, addPinch) {\n\t\tvar touchAction = 'none';\n\t\tif ( eventPassthrough === 'vertical' ) {\n\t\t\ttouchAction = 'pan-y';\n\t\t} else if (eventPassthrough === 'horizontal' ) {\n\t\t\ttouchAction = 'pan-x';\n\t\t}\n\t\tif (addPinch && touchAction != 'none') {\n\t\t\t// add pinch-zoom support if the browser supports it, but if not (eg. Chrome <55) do nothing\n\t\t\ttouchAction += ' pinch-zoom';\n\t\t}\n\t\treturn touchAction;\n\t};\n\n\tme.getRect = function(el) {\n\t\tif (el instanceof SVGElement) {\n\t\t\tvar rect = el.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop : rect.top,\n\t\t\t\tleft : rect.left,\n\t\t\t\twidth : rect.width,\n\t\t\t\theight : rect.height\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttop : el.offsetTop,\n\t\t\t\tleft : el.offsetLeft,\n\t\t\t\twidth : el.offsetWidth,\n\t\t\t\theight : el.offsetHeight\n\t\t\t};\n\t\t}\n\t};\n\n\treturn me;\n})();\nfunction IScroll (el, options) {\n\tthis.wrapper = typeof el == 'string' ? document.querySelector(el) : el;\n\tthis.scroller = this.wrapper.children[0];\n\tthis.scrollerStyle = this.scroller.style;\t\t// cache style for better performance\n\n\tthis.options = {\n\n\t\tresizeScrollbars: true,\n\n\t\tmouseWheelSpeed: 20,\n\n\t\tsnapThreshold: 0.334,\n\n// INSERT POINT: OPTIONS\n\t\tdisablePointer : !utils.hasPointer,\n\t\tdisableTouch : utils.hasPointer || !utils.hasTouch,\n\t\tdisableMouse : utils.hasPointer || utils.hasTouch,\n\t\tstartX: 0,\n\t\tstartY: 0,\n\t\tscrollY: true,\n\t\tdirectionLockThreshold: 5,\n\t\tmomentum: true,\n\n\t\tbounce: true,\n\t\tbounceTime: 600,\n\t\tbounceEasing: '',\n\n\t\tpreventDefault: true,\n\t\tpreventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },\n\n\t\tHWCompositing: true,\n\t\tuseTransition: true,\n\t\tuseTransform: true,\n\t\tbindToWrapper: typeof window.onmousedown === \"undefined\"\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\t// Normalize options\n\tthis.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';\n\n\tthis.options.useTransition = utils.hasTransition && this.options.useTransition;\n\tthis.options.useTransform = utils.hasTransform && this.options.useTransform;\n\n\tthis.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;\n\tthis.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;\n\n\t// If you want eventPassthrough I have to lock one of the axes\n\tthis.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;\n\tthis.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;\n\n\t// With eventPassthrough we also need lockDirection mechanism\n\tthis.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;\n\tthis.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;\n\n\tthis.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;\n\n\tthis.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;\n\n\tif ( this.options.tap === true ) {\n\t\tthis.options.tap = 'tap';\n\t}\n\n\t// https://github.com/cubiq/iscroll/issues/1029\n\tif (!this.options.useTransition && !this.options.useTransform) {\n\t\tif(!(/relative|absolute/i).test(this.scrollerStyle.position)) {\n\t\t\tthis.scrollerStyle.position = \"relative\";\n\t\t}\n\t}\n\n\tif ( this.options.shrinkScrollbars == 'scale' ) {\n\t\tthis.options.useTransition = false;\n\t}\n\n\tthis.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;\n\n\tif ( this.options.probeType == 3 ) {\n\t\tthis.options.useTransition = false;\t}\n\n// INSERT POINT: NORMALIZATION\n\n\t// Some defaults\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.directionX = 0;\n\tthis.directionY = 0;\n\tthis._events = {};\n\n// INSERT POINT: DEFAULTS\n\n\tthis._init();\n\tthis.refresh();\n\n\tthis.scrollTo(this.options.startX, this.options.startY);\n\tthis.enable();\n}\n\nIScroll.prototype = {\n\tversion: '5.2.0-snapshot',\n\n\t_init: function () {\n\t\tthis._initEvents();\n\n\t\tif ( this.options.scrollbars || this.options.indicators ) {\n\t\t\tthis._initIndicators();\n\t\t}\n\n\t\tif ( this.options.mouseWheel ) {\n\t\t\tthis._initWheel();\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tthis._initSnap();\n\t\t}\n\n\t\tif ( this.options.keyBindings ) {\n\t\t\tthis._initKeys();\n\t\t}\n\n// INSERT POINT: _init\n\n\t},\n\n\tdestroy: function () {\n\t\tthis._initEvents(true);\n\t\tclearTimeout(this.resizeTimeout);\n \t\tthis.resizeTimeout = null;\n\t\tthis._execEvent('destroy');\n\t},\n\n\t_transitionEnd: function (e) {\n\t\tif ( e.target != this.scroller || !this.isInTransition ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._transitionTime();\n\t\tif ( !this.resetPosition(this.options.bounceTime) ) {\n\t\t\tthis.isInTransition = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\t// React to left mouse button only\n\t\tif ( utils.eventType[e.type] != 1 ) {\n\t\t  // for button property\n\t\t  // http://unixpapa.com/js/mouse.html\n\t\t  var button;\n\t    if (!e.which) {\n\t      /* IE case */\n\t      button = (e.button < 2) ? 0 :\n\t               ((e.button == 4) ? 1 : 2);\n\t    } else {\n\t      /* All others */\n\t      button = e.button;\n\t    }\n\t\t\tif ( button !== 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tpos;\n\n\t\tthis.initiated\t= utils.eventType[e.type];\n\t\tthis.moved\t\t= false;\n\t\tthis.distX\t\t= 0;\n\t\tthis.distY\t\t= 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\tthis.directionLocked = 0;\n\n\t\tthis.startTime = utils.getTime();\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tthis._transitionTime();\n\t\t\tthis.isInTransition = false;\n\t\t\tpos = this.getComputedPosition();\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis._execEvent('scrollEnd');\n\t\t} else if ( !this.options.useTransition && this.isAnimating ) {\n\t\t\tthis.isAnimating = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\n\t\tthis.startX    = this.x;\n\t\tthis.startY    = this.y;\n\t\tthis.absStartX = this.x;\n\t\tthis.absStartY = this.y;\n\t\tthis.pointX    = point.pageX;\n\t\tthis.pointY    = point.pageY;\n\n\t\tthis._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\t// increases performance on Android? TODO: check!\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point\t\t= e.touches ? e.touches[0] : e,\n\t\t\tdeltaX\t\t= point.pageX - this.pointX,\n\t\t\tdeltaY\t\t= point.pageY - this.pointY,\n\t\t\ttimestamp\t= utils.getTime(),\n\t\t\tnewX, newY,\n\t\t\tabsDistX, absDistY;\n\n\t\tthis.pointX\t\t= point.pageX;\n\t\tthis.pointY\t\t= point.pageY;\n\n\t\tthis.distX\t\t+= deltaX;\n\t\tthis.distY\t\t+= deltaY;\n\t\tabsDistX\t\t= Math.abs(this.distX);\n\t\tabsDistY\t\t= Math.abs(this.distY);\n\n\t\t// We need to move at least 10 pixels for the scrolling to initiate\n\t\tif ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If you are scrolling in one direction lock the other\n\t\tif ( !this.directionLocked && !this.options.freeScroll ) {\n\t\t\tif ( absDistX > absDistY + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'h';\t\t// lock horizontally\n\t\t\t} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'v';\t\t// lock vertically\n\t\t\t} else {\n\t\t\t\tthis.directionLocked = 'n';\t\t// no lock\n\t\t\t}\n\t\t}\n\n\t\tif ( this.directionLocked == 'h' ) {\n\t\t\tif ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaY = 0;\n\t\t} else if ( this.directionLocked == 'v' ) {\n\t\t\tif ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaX = 0;\n\t\t}\n\n\t\tdeltaX = this.hasHorizontalScroll ? deltaX : 0;\n\t\tdeltaY = this.hasVerticalScroll ? deltaY : 0;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\t// Slow down if outside of the boundaries\n\t\tif ( newX > 0 || newX < this.maxScrollX ) {\n\t\t\tnewX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;\n\t\t}\n\t\tif ( newY > 0 || newY < this.maxScrollY ) {\n\t\t\tnewY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;\n\t\t}\n\n\t\tthis.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;\n\t\tthis.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;\n\n\t\tif ( !this.moved ) {\n\t\t\tthis._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tthis._translate(newX, newY);\n\n/* REPLACE START: _move */\n\t\tif ( timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.startX = this.x;\n\t\t\tthis.startY = this.y;\n\n\t\t\tif ( this.options.probeType == 1 ) {\n\t\t\t\tthis._execEvent('scroll');\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.probeType > 1 ) {\n\t\t\tthis._execEvent('scroll');\n\t\t}\n/* REPLACE END: _move */\n\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.changedTouches ? e.changedTouches[0] : e,\n\t\t\tmomentumX,\n\t\t\tmomentumY,\n\t\t\tduration = utils.getTime() - this.startTime,\n\t\t\tnewX = Math.round(this.x),\n\t\t\tnewY = Math.round(this.y),\n\t\t\tdistanceX = Math.abs(newX - this.startX),\n\t\t\tdistanceY = Math.abs(newY - this.startY),\n\t\t\ttime = 0,\n\t\t\teasing = '';\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\t\tthis.endTime = utils.getTime();\n\n\t\t// reset if we are outside of the boundaries\n\t\tif ( this.resetPosition(this.options.bounceTime) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY);\t// ensures that the last position is rounded\n\n\t\t// we scrolled less than 10 pixels\n\t\tif ( !this.moved ) {\n\t\t\tif ( this.options.tap ) {\n\t\t\t\tutils.tap(e, this.options.tap);\n\t\t\t}\n\n\t\t\tif ( this.options.click ) {\n\t\t\t\tutils.click(e);\n\t\t\t}\n\n\t\t\tthis._execEvent('scrollCancel');\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {\n\t\t\tthis._execEvent('flick');\n\t\t\treturn;\n\t\t}\n\n\t\t// start momentum animation if needed\n\t\tif ( this.options.momentum && duration < 300 ) {\n\t\t\tmomentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };\n\t\t\tmomentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };\n\t\t\tnewX = momentumX.destination;\n\t\t\tnewY = momentumY.destination;\n\t\t\ttime = Math.max(momentumX.duration, momentumY.duration);\n\t\t\tthis.isInTransition = 1;\n\t\t}\n\n\n\t\tif ( this.options.snap ) {\n\t\t\tvar snap = this._nearestSnap(newX, newY);\n\t\t\tthis.currentPage = snap;\n\t\t\ttime = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(newX - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(newY - snap.y), 1000)\n\t\t\t\t\t), 300);\n\t\t\tnewX = snap.x;\n\t\t\tnewY = snap.y;\n\n\t\t\tthis.directionX = 0;\n\t\t\tthis.directionY = 0;\n\t\t\teasing = this.options.bounceEasing;\n\t\t}\n\n// INSERT POINT: _end\n\n\t\tif ( newX != this.x || newY != this.y ) {\n\t\t\t// change easing function when scroller goes out of the boundaries\n\t\t\tif ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {\n\t\t\t\teasing = utils.ease.quadratic;\n\t\t\t}\n\n\t\t\tthis.scrollTo(newX, newY, time, easing);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._execEvent('scrollEnd');\n\t},\n\n\t_resize: function () {\n\t\tvar that = this;\n\n\t\tclearTimeout(this.resizeTimeout);\n\n\t\tthis.resizeTimeout = setTimeout(function () {\n\t\t\tthat.refresh();\n\t\t}, this.options.resizePolling);\n\t},\n\n\tresetPosition: function (time) {\n\t\tvar x = this.x,\n\t\t\ty = this.y;\n\n\t\ttime = time || 0;\n\n\t\tif ( !this.hasHorizontalScroll || this.x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( this.x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll || this.y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( this.y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tif ( x == this.x && y == this.y ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time, this.options.bounceEasing);\n\n\t\treturn true;\n\t},\n\n\tdisable: function () {\n\t\tthis.enabled = false;\n\t},\n\n\tenable: function () {\n\t\tthis.enabled = true;\n\t},\n\n\trefresh: function () {\n\t\tutils.getRect(this.wrapper);\t\t// Force reflow\n\n\t\tthis.wrapperWidth\t= this.wrapper.clientWidth;\n\t\tthis.wrapperHeight\t= this.wrapper.clientHeight;\n\n\t\tvar rect = utils.getRect(this.scroller);\n/* REPLACE START: refresh */\n\n\t\tthis.scrollerWidth\t= rect.width;\n\t\tthis.scrollerHeight\t= rect.height;\n\n\t\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\t\tthis.maxScrollY\t\t= this.wrapperHeight - this.scrollerHeight;\n\n/* REPLACE END: refresh */\n\n\t\tthis.hasHorizontalScroll\t= this.options.scrollX && this.maxScrollX < 0;\n\t\tthis.hasVerticalScroll\t\t= this.options.scrollY && this.maxScrollY < 0;\n\t\t\n\t\tif ( !this.hasHorizontalScroll ) {\n\t\t\tthis.maxScrollX = 0;\n\t\t\tthis.scrollerWidth = this.wrapperWidth;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\tthis.maxScrollY = 0;\n\t\t\tthis.scrollerHeight = this.wrapperHeight;\n\t\t}\n\n\t\tthis.endTime = 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\t\n\t\tif(utils.hasPointer && !this.options.disablePointer) {\n\t\t\t// The wrapper should have `touchAction` property for using pointerEvent.\n\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, true);\n\n\t\t\t// case. not support 'pinch-zoom'\n\t\t\t// https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583\n\t\t\tif (!this.wrapper.style[utils.style.touchAction]) {\n\t\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, false);\n\t\t\t}\n\t\t}\n\t\tthis.wrapperOffset = utils.offset(this.wrapper);\n\n\t\tthis._execEvent('refresh');\n\n\t\tthis.resetPosition();\n\n// INSERT POINT: _refresh\n\n\t},\t\n\n\ton: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\tthis._events[type] = [];\n\t\t}\n\n\t\tthis._events[type].push(fn);\n\t},\n\n\toff: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar index = this._events[type].indexOf(fn);\n\n\t\tif ( index > -1 ) {\n\t\t\tthis._events[type].splice(index, 1);\n\t\t}\n\t},\n\n\t_execEvent: function (type) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this._events[type].length;\n\n\t\tif ( !l ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tthis._events[type][i].apply(this, [].slice.call(arguments, 1));\n\t\t}\n\t},\n\n\tscrollBy: function (x, y, time, easing) {\n\t\tx = this.x + x;\n\t\ty = this.y + y;\n\t\ttime = time || 0;\n\n\t\tthis.scrollTo(x, y, time, easing);\n\t},\n\n\tscrollTo: function (x, y, time, easing) {\n\t\teasing = easing || utils.ease.circular;\n\n\t\tthis.isInTransition = this.options.useTransition && time > 0;\n\t\tvar transitionType = this.options.useTransition && easing.style;\n\t\tif ( !time || transitionType ) {\n\t\t\t\tif(transitionType) {\n\t\t\t\t\tthis._transitionTimingFunction(easing.style);\n\t\t\t\t\tthis._transitionTime(time);\n\t\t\t\t}\n\t\t\tthis._translate(x, y);\n\t\t} else {\n\t\t\tthis._animate(x, y, time, easing.fn);\n\t\t}\n\t},\n\n\tscrollToElement: function (el, time, offsetX, offsetY, easing) {\n\t\tel = el.nodeType ? el : this.scroller.querySelector(el);\n\n\t\tif ( !el ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar pos = utils.offset(el);\n\n\t\tpos.left -= this.wrapperOffset.left;\n\t\tpos.top  -= this.wrapperOffset.top;\n\n\t\t// if offsetX/Y are true we center the element to the screen\n\t\tvar elRect = utils.getRect(el);\n\t\tvar wrapperRect = utils.getRect(this.wrapper);\n\t\tif ( offsetX === true ) {\n\t\t\toffsetX = Math.round(elRect.width / 2 - wrapperRect.width / 2);\n\t\t}\n\t\tif ( offsetY === true ) {\n\t\t\toffsetY = Math.round(elRect.height / 2 - wrapperRect.height / 2);\n\t\t}\n\n\t\tpos.left -= offsetX || 0;\n\t\tpos.top  -= offsetY || 0;\n\n\t\tpos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;\n\t\tpos.top  = pos.top  > 0 ? 0 : pos.top  < this.maxScrollY ? this.maxScrollY : pos.top;\n\n\t\ttime = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;\n\n\t\tthis.scrollTo(pos.left, pos.top, time, easing);\n\t},\n\n\t_transitionTime: function (time) {\n\t\tif (!this.options.useTransition) {\n\t\t\treturn;\n\t\t}\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollerStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.scrollerStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.scrollerStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.scrollerStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTime(time);\n\t\t\t}\n\t\t}\n\n\n// INSERT POINT: _transitionTime\n\n\t},\n\n\t_transitionTimingFunction: function (easing) {\n\t\tthis.scrollerStyle[utils.style.transitionTimingFunction] = easing;\n\n\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTimingFunction(easing);\n\t\t\t}\n\t\t}\n\n\n// INSERT POINT: _transitionTimingFunction\n\n\t},\n\n\t_translate: function (x, y) {\n\t\tif ( this.options.useTransform ) {\n\n/* REPLACE START: _translate */\n\n\t\t\tthis.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;\n\n/* REPLACE END: _translate */\n\n\t\t} else {\n\t\t\tx = Math.round(x);\n\t\t\ty = Math.round(y);\n\t\t\tthis.scrollerStyle.left = x + 'px';\n\t\t\tthis.scrollerStyle.top = y + 'px';\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\n\tif ( this.indicators ) {\n\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\tthis.indicators[i].updatePosition();\n\t\t}\n\t}\n\n\n// INSERT POINT: _translate\n\n\t},\n\n\t_initEvents: function (remove) {\n\t\tvar eventType = remove ? utils.removeEvent : utils.addEvent,\n\t\t\ttarget = this.options.bindToWrapper ? this.wrapper : window;\n\n\t\teventType(window, 'orientationchange', this);\n\t\teventType(window, 'resize', this);\n\n\t\tif ( this.options.click ) {\n\t\t\teventType(this.wrapper, 'click', this, true);\n\t\t}\n\n\t\tif ( !this.options.disableMouse ) {\n\t\t\teventType(this.wrapper, 'mousedown', this);\n\t\t\teventType(target, 'mousemove', this);\n\t\t\teventType(target, 'mousecancel', this);\n\t\t\teventType(target, 'mouseup', this);\n\t\t}\n\n\t\tif ( utils.hasPointer && !this.options.disablePointer ) {\n\t\t\teventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointermove'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointercancel'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\n\t\tif ( utils.hasTouch && !this.options.disableTouch ) {\n\t\t\teventType(this.wrapper, 'touchstart', this);\n\t\t\teventType(target, 'touchmove', this);\n\t\t\teventType(target, 'touchcancel', this);\n\t\t\teventType(target, 'touchend', this);\n\t\t}\n\n\t\teventType(this.scroller, 'transitionend', this);\n\t\teventType(this.scroller, 'webkitTransitionEnd', this);\n\t\teventType(this.scroller, 'oTransitionEnd', this);\n\t\teventType(this.scroller, 'MSTransitionEnd', this);\n\t},\n\n\tgetComputedPosition: function () {\n\t\tvar matrix = window.getComputedStyle(this.scroller, null),\n\t\t\tx, y;\n\n\t\tif ( this.options.useTransform ) {\n\t\t\tmatrix = matrix[utils.style.transform].split(')')[0].split(', ');\n\t\t\tx = +(matrix[12] || matrix[4]);\n\t\t\ty = +(matrix[13] || matrix[5]);\n\t\t} else {\n\t\t\tx = +matrix.left.replace(/[^-\\d.]/g, '');\n\t\t\ty = +matrix.top.replace(/[^-\\d.]/g, '');\n\t\t}\n\n\t\treturn { x: x, y: y };\n\t},\n\t_initIndicators: function () {\n\t\tvar interactive = this.options.interactiveScrollbars,\n\t\t\tcustomStyle = typeof this.options.scrollbars != 'string',\n\t\t\tindicators = [],\n\t\t\tindicator;\n\n\t\tvar that = this;\n\n\t\tthis.indicators = [];\n\n\t\tif ( this.options.scrollbars ) {\n\t\t\t// Vertical scrollbar\n\t\t\tif ( this.options.scrollY ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('v', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenX: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\n\t\t\t// Horizontal scrollbar\n\t\t\tif ( this.options.scrollX ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('h', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenY: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.indicators ) {\n\t\t\t// TODO: check concat compatibility\n\t\t\tindicators = indicators.concat(this.options.indicators);\n\t\t}\n\n\t\tfor ( var i = indicators.length; i--; ) {\n\t\t\tthis.indicators.push( new Indicator(this, indicators[i]) );\n\t\t}\n\n\t\t// TODO: check if we can use array.map (wide compatibility and performance issues)\n\t\tfunction _indicatorsMap (fn) {\n\t\t\tif (that.indicators) {\n\t\t\t\tfor ( var i = that.indicators.length; i--; ) {\n\t\t\t\t\tfn.call(that.indicators[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tthis.on('scrollEnd', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollCancel', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('beforeScrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1, true);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\n\t\tthis.on('refresh', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.refresh();\n\t\t\t});\n\t\t});\n\n\t\tthis.on('destroy', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.destroy();\n\t\t\t});\n\n\t\t\tdelete this.indicators;\n\t\t});\n\t},\n\n\t_initWheel: function () {\n\t\tutils.addEvent(this.wrapper, 'wheel', this);\n\t\tutils.addEvent(this.wrapper, 'mousewheel', this);\n\t\tutils.addEvent(this.wrapper, 'DOMMouseScroll', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tclearTimeout(this.wheelTimeout);\n\t\t\tthis.wheelTimeout = null;\n\t\t\tutils.removeEvent(this.wrapper, 'wheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'mousewheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'DOMMouseScroll', this);\n\t\t});\n\t},\n\n\t_wheel: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tvar wheelDeltaX, wheelDeltaY,\n\t\t\tnewX, newY,\n\t\t\tthat = this;\n\n\t\tif ( this.wheelTimeout === undefined ) {\n\t\t\tthat._execEvent('scrollStart');\n\t\t}\n\n\t\t// Execute the scrollEnd event after 400ms the wheel stopped scrolling\n\t\tclearTimeout(this.wheelTimeout);\n\t\tthis.wheelTimeout = setTimeout(function () {\n\t\t\tif(!that.options.snap) {\n\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t}\n\t\t\tthat.wheelTimeout = undefined;\n\t\t}, 400);\n\n\t\tif ( 'deltaX' in e ) {\n\t\t\tif (e.deltaMode === 1) {\n\t\t\t\twheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;\n\t\t\t\twheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;\n\t\t\t} else {\n\t\t\t\twheelDeltaX = -e.deltaX;\n\t\t\t\twheelDeltaY = -e.deltaY;\n\t\t\t}\n\t\t} else if ( 'wheelDeltaX' in e ) {\n\t\t\twheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;\n\t\t\twheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'wheelDelta' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'detail' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\twheelDeltaX *= this.options.invertWheelDirection;\n\t\twheelDeltaY *= this.options.invertWheelDirection;\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\twheelDeltaX = wheelDeltaY;\n\t\t\twheelDeltaY = 0;\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tnewX = this.currentPage.pageX;\n\t\t\tnewY = this.currentPage.pageY;\n\n\t\t\tif ( wheelDeltaX > 0 ) {\n\t\t\t\tnewX--;\n\t\t\t} else if ( wheelDeltaX < 0 ) {\n\t\t\t\tnewX++;\n\t\t\t}\n\n\t\t\tif ( wheelDeltaY > 0 ) {\n\t\t\t\tnewY--;\n\t\t\t} else if ( wheelDeltaY < 0 ) {\n\t\t\t\tnewY++;\n\t\t\t}\n\n\t\t\tthis.goToPage(newX, newY);\n\n\t\t\treturn;\n\t\t}\n\n\t\tnewX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);\n\t\tnewY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);\n\n\t\tthis.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;\n\t\tthis.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n\t\tif ( this.options.probeType > 1 ) {\n\t\t\tthis._execEvent('scroll');\n\t\t}\n\n// INSERT POINT: _wheel\n\t},\n\n\t_initSnap: function () {\n\t\tthis.currentPage = {};\n\n\t\tif ( typeof this.options.snap == 'string' ) {\n\t\t\tthis.options.snap = this.scroller.querySelectorAll(this.options.snap);\n\t\t}\n\n\t\tthis.on('refresh', function () {\n\t\t\tvar i = 0, l,\n\t\t\t\tm = 0, n,\n\t\t\t\tcx, cy,\n\t\t\t\tx = 0, y,\n\t\t\t\tstepX = this.options.snapStepX || this.wrapperWidth,\n\t\t\t\tstepY = this.options.snapStepY || this.wrapperHeight,\n\t\t\t\tel,\n\t\t\t\trect;\n\n\t\t\tthis.pages = [];\n\n\t\t\tif ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.options.snap === true ) {\n\t\t\t\tcx = Math.round( stepX / 2 );\n\t\t\t\tcy = Math.round( stepY / 2 );\n\n\t\t\t\twhile ( x > -this.scrollerWidth ) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile ( y > -this.scrollerHeight ) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tel = this.options.snap;\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\trect = utils.getRect(el[i]);\n\t\t\t\t\tif ( i === 0 || rect.left <= utils.getRect(el[i-1]).left ) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !this.pages[m] ) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( x > this.maxScrollX ) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);\n\n\t\t\t// Update snap threshold if needed\n\t\t\tif ( this.options.snapThreshold % 1 === 0 ) {\n\t\t\t\tthis.snapThresholdX = this.options.snapThreshold;\n\t\t\t\tthis.snapThresholdY = this.options.snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('flick', function () {\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tthis.goToPage(\n\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\ttime\n\t\t\t);\n\t\t});\n\t},\n\n\t_nearestSnap: function (x, y) {\n\t\tif ( !this.pages.length ) {\n\t\t\treturn { x: 0, y: 0, pageX: 0, pageY: 0 };\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this.pages.length,\n\t\t\tm = 0;\n\n\t\t// Check if we exceeded the snap threshold\n\t\tif ( Math.abs(x - this.absStartX) < this.snapThresholdX &&\n\t\t\tMath.abs(y - this.absStartY) < this.snapThresholdY ) {\n\t\t\treturn this.currentPage;\n\t\t}\n\n\t\tif ( x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( x >= this.pages[i][0].cx ) {\n\t\t\t\tx = this.pages[i][0].x;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tl = this.pages[i].length;\n\n\t\tfor ( ; m < l; m++ ) {\n\t\t\tif ( y >= this.pages[0][m].cy ) {\n\t\t\t\ty = this.pages[0][m].y;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( i == this.currentPage.pageX ) {\n\t\t\ti += this.directionX;\n\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t} else if ( i >= this.pages.length ) {\n\t\t\t\ti = this.pages.length - 1;\n\t\t\t}\n\n\t\t\tx = this.pages[i][0].x;\n\t\t}\n\n\t\tif ( m == this.currentPage.pageY ) {\n\t\t\tm += this.directionY;\n\n\t\t\tif ( m < 0 ) {\n\t\t\t\tm = 0;\n\t\t\t} else if ( m >= this.pages[0].length ) {\n\t\t\t\tm = this.pages[0].length - 1;\n\t\t\t}\n\n\t\t\ty = this.pages[0][m].y;\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tpageX: i,\n\t\t\tpageY: m\n\t\t};\n\t},\n\n\tgoToPage: function (x, y, time, easing) {\n\t\teasing = easing || this.options.bounceEasing;\n\n\t\tif ( x >= this.pages.length ) {\n\t\t\tx = this.pages.length - 1;\n\t\t} else if ( x < 0 ) {\n\t\t\tx = 0;\n\t\t}\n\n\t\tif ( y >= this.pages[x].length ) {\n\t\t\ty = this.pages[x].length - 1;\n\t\t} else if ( y < 0 ) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tvar posX = this.pages[x][y].x,\n\t\t\tposY = this.pages[x][y].y;\n\n\t\ttime = time === undefined ? this.options.snapSpeed || Math.max(\n\t\t\tMath.max(\n\t\t\t\tMath.min(Math.abs(posX - this.x), 1000),\n\t\t\t\tMath.min(Math.abs(posY - this.y), 1000)\n\t\t\t), 300) : time;\n\n\t\tthis.currentPage = {\n\t\t\tx: posX,\n\t\t\ty: posY,\n\t\t\tpageX: x,\n\t\t\tpageY: y\n\t\t};\n\n\t\tthis.scrollTo(posX, posY, time, easing);\n\t},\n\n\tnext: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx++;\n\n\t\tif ( x >= this.pages.length && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty++;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\tprev: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx--;\n\n\t\tif ( x < 0 && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty--;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\t_initKeys: function (e) {\n\t\t// default key bindings\n\t\tvar keys = {\n\t\t\tpageUp: 33,\n\t\t\tpageDown: 34,\n\t\t\tend: 35,\n\t\t\thome: 36,\n\t\t\tleft: 37,\n\t\t\tup: 38,\n\t\t\tright: 39,\n\t\t\tdown: 40\n\t\t};\n\t\tvar i;\n\n\t\t// if you give me characters I give you keycode\n\t\tif ( typeof this.options.keyBindings == 'object' ) {\n\t\t\tfor ( i in this.options.keyBindings ) {\n\t\t\t\tif ( typeof this.options.keyBindings[i] == 'string' ) {\n\t\t\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.options.keyBindings = {};\n\t\t}\n\n\t\tfor ( i in keys ) {\n\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];\n\t\t}\n\n\t\tutils.addEvent(window, 'keydown', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tutils.removeEvent(window, 'keydown', this);\n\t\t});\n\t},\n\n\t_key: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar snap = this.options.snap,\t// we are using this alot, better to cache it\n\t\t\tnewX = snap ? this.currentPage.pageX : this.x,\n\t\t\tnewY = snap ? this.currentPage.pageY : this.y,\n\t\t\tnow = utils.getTime(),\n\t\t\tprevTime = this.keyTime || 0,\n\t\t\tacceleration = 0.250,\n\t\t\tpos;\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tpos = this.getComputedPosition();\n\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis.isInTransition = false;\n\t\t}\n\n\t\tthis.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;\n\n\t\tswitch ( e.keyCode ) {\n\t\t\tcase this.options.keyBindings.pageUp:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX += snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY += snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.pageDown:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX -= snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY -= snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.end:\n\t\t\t\tnewX = snap ? this.pages.length-1 : this.maxScrollX;\n\t\t\t\tnewY = snap ? this.pages[0].length-1 : this.maxScrollY;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.home:\n\t\t\t\tnewX = 0;\n\t\t\t\tnewY = 0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.left:\n\t\t\t\tnewX += snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.up:\n\t\t\t\tnewY += snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.right:\n\t\t\t\tnewX -= snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.down:\n\t\t\t\tnewY -= snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ( snap ) {\n\t\t\tthis.goToPage(newX, newY);\n\t\t\treturn;\n\t\t}\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n\t\tthis.keyTime = now;\n\t},\n\n\t_animate: function (destX, destY, duration, easingFn) {\n\t\tvar that = this,\n\t\t\tstartX = this.x,\n\t\t\tstartY = this.y,\n\t\t\tstartTime = utils.getTime(),\n\t\t\tdestTime = startTime + duration;\n\n\t\tfunction step () {\n\t\t\tvar now = utils.getTime(),\n\t\t\t\tnewX, newY,\n\t\t\t\teasing;\n\n\t\t\tif ( now >= destTime ) {\n\t\t\t\tthat.isAnimating = false;\n\t\t\t\tthat._translate(destX, destY);\n\t\t\t\t\n\t\t\t\tif ( !that.resetPosition(that.options.bounceTime) ) {\n\t\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnow = ( now - startTime ) / duration;\n\t\t\teasing = easingFn(now);\n\t\t\tnewX = ( destX - startX ) * easing + startX;\n\t\t\tnewY = ( destY - startY ) * easing + startY;\n\t\t\tthat._translate(newX, newY);\n\n\t\t\tif ( that.isAnimating ) {\n\t\t\t\trAF(step);\n\t\t\t}\n\n\t\t\tif ( that.options.probeType == 3 ) {\n\t\t\t\tthat._execEvent('scroll');\n\t\t\t}\n\t\t}\n\n\t\tthis.isAnimating = true;\n\t\tstep();\n\t},\n\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t\tcase 'orientationchange':\n\t\t\tcase 'resize':\n\t\t\t\tthis._resize();\n\t\t\t\tbreak;\n\t\t\tcase 'transitionend':\n\t\t\tcase 'webkitTransitionEnd':\n\t\t\tcase 'oTransitionEnd':\n\t\t\tcase 'MSTransitionEnd':\n\t\t\t\tthis._transitionEnd(e);\n\t\t\t\tbreak;\n\t\t\tcase 'wheel':\n\t\t\tcase 'DOMMouseScroll':\n\t\t\tcase 'mousewheel':\n\t\t\t\tthis._wheel(e);\n\t\t\t\tbreak;\n\t\t\tcase 'keydown':\n\t\t\t\tthis._key(e);\n\t\t\t\tbreak;\n\t\t\tcase 'click':\n\t\t\t\tif ( this.enabled && !e._constructed ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n};\nfunction createDefaultScrollbar (direction, interactive, type) {\n\tvar scrollbar = document.createElement('div'),\n\t\tindicator = document.createElement('div');\n\n\tif ( type === true ) {\n\t\tscrollbar.style.cssText = 'position:absolute;z-index:9999';\n\t\tindicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';\n\t}\n\n\tindicator.className = 'iScrollIndicator';\n\n\tif ( direction == 'h' ) {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';\n\t\t\tindicator.style.height = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollHorizontalScrollbar';\n\t} else {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';\n\t\t\tindicator.style.width = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollVerticalScrollbar';\n\t}\n\n\tscrollbar.style.cssText += ';overflow:hidden';\n\n\tif ( !interactive ) {\n\t\tscrollbar.style.pointerEvents = 'none';\n\t}\n\n\tscrollbar.appendChild(indicator);\n\n\treturn scrollbar;\n}\n\nfunction Indicator (scroller, options) {\n\tthis.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;\n\tthis.wrapperStyle = this.wrapper.style;\n\tthis.indicator = this.wrapper.children[0];\n\tthis.indicatorStyle = this.indicator.style;\n\tthis.scroller = scroller;\n\n\tthis.options = {\n\t\tlistenX: true,\n\t\tlistenY: true,\n\t\tinteractive: false,\n\t\tresize: true,\n\t\tdefaultScrollbars: false,\n\t\tshrink: false,\n\t\tfade: false,\n\t\tspeedRatioX: 0,\n\t\tspeedRatioY: 0\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\tthis.sizeRatioX = 1;\n\tthis.sizeRatioY = 1;\n\tthis.maxPosX = 0;\n\tthis.maxPosY = 0;\n\n\tif ( this.options.interactive ) {\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.addEvent(window, 'touchend', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(this.indicator, 'mousedown', this);\n\t\t\tutils.addEvent(window, 'mouseup', this);\n\t\t}\n\t}\n\n\tif ( this.options.fade ) {\n\t\tthis.wrapperStyle[utils.style.transform] = this.scroller.translateZ;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\t\tthis.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';\n\t\t// remove 0.0001ms\n\t\tvar self = this;\n\t\tif(utils.isBadAndroid) {\n\t\t\trAF(function() {\n\t\t\t\tif(self.wrapperStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.wrapperStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tthis.wrapperStyle.opacity = '0';\n\t}\n}\n\nIndicator.prototype = {\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t}\n\t},\n\n\tdestroy: function () {\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tclearTimeout(this.fadeTimeout);\n\t\t\tthis.fadeTimeout = null;\n\t\t}\n\t\tif ( this.options.interactive ) {\n\t\t\tutils.removeEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.removeEvent(this.indicator, 'mousedown', this);\n\n\t\t\tutils.removeEvent(window, 'touchmove', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\t\tutils.removeEvent(window, 'touchend', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t\tutils.removeEvent(window, 'mouseup', this);\n\t\t}\n\n\t\tif ( this.options.defaultScrollbars && this.wrapper.parentNode ) {\n\t\t\tthis.wrapper.parentNode.removeChild(this.wrapper);\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tthis.transitionTime();\n\n\t\tthis.initiated = true;\n\t\tthis.moved = false;\n\t\tthis.lastPointX\t= point.pageX;\n\t\tthis.lastPointY\t= point.pageY;\n\n\t\tthis.startTime\t= utils.getTime();\n\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(window, 'touchmove', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(window, 'mousemove', this);\n\t\t}\n\n\t\tthis.scroller._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tdeltaX, deltaY,\n\t\t\tnewX, newY,\n\t\t\ttimestamp = utils.getTime();\n\n\t\tif ( !this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tdeltaX = point.pageX - this.lastPointX;\n\t\tthis.lastPointX = point.pageX;\n\n\t\tdeltaY = point.pageY - this.lastPointY;\n\t\tthis.lastPointY = point.pageY;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\tthis._pos(newX, newY);\n\n\n\t\tif ( this.scroller.options.probeType == 1 && timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.scroller._execEvent('scroll');\n\t\t} else if ( this.scroller.options.probeType > 1 ) {\n\t\t\tthis.scroller._execEvent('scroll');\n\t\t}\n\n\n// INSERT POINT: indicator._move\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.initiated = false;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tutils.removeEvent(window, 'touchmove', this);\n\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\tif ( this.scroller.options.snap ) {\n\t\t\tvar snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);\n\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.x - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.y - snap.y), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tif ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {\n\t\t\t\tthis.scroller.directionX = 0;\n\t\t\t\tthis.scroller.directionY = 0;\n\t\t\t\tthis.scroller.currentPage = snap;\n\t\t\t\tthis.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\ttransitionTime: function (time) {\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.indicatorStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.indicatorStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.indicatorStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.indicatorStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\ttransitionTimingFunction: function (easing) {\n\t\tthis.indicatorStyle[utils.style.transitionTimingFunction] = easing;\n\t},\n\n\trefresh: function () {\n\t\tthis.transitionTime();\n\n\t\tif ( this.options.listenX && !this.options.listenY ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';\n\t\t} else if ( this.options.listenY && !this.options.listenX ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t} else {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t}\n\n\t\tif ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {\n\t\t\tutils.addClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.removeClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '8px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '8px';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tutils.removeClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.addClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '2px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '2px';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tutils.getRect(this.wrapper);\t// force refresh\n\n\t\tif ( this.options.listenX ) {\n\t\t\tthis.wrapperWidth = this.wrapper.clientWidth;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);\n\t\t\t\tthis.indicatorStyle.width = this.indicatorWidth + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorWidth = this.indicator.clientWidth;\n\t\t\t}\n\n\t\t\tthis.maxPosX = this.wrapperWidth - this.indicatorWidth;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryX = -this.indicatorWidth + 8;\n\t\t\t\tthis.maxBoundaryX = this.wrapperWidth - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryX = 0;\n\t\t\t\tthis.maxBoundaryX = this.maxPosX;\n\t\t\t}\n\n\t\t\tthis.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));\n\t\t}\n\n\t\tif ( this.options.listenY ) {\n\t\t\tthis.wrapperHeight = this.wrapper.clientHeight;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);\n\t\t\t\tthis.indicatorStyle.height = this.indicatorHeight + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorHeight = this.indicator.clientHeight;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryY = -this.indicatorHeight + 8;\n\t\t\t\tthis.maxBoundaryY = this.wrapperHeight - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryY = 0;\n\t\t\t\tthis.maxBoundaryY = this.maxPosY;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\t\t\tthis.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY));\n\t\t}\n\n\t\tthis.updatePosition();\n\t},\n\n\tupdatePosition: function () {\n\t\tvar x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,\n\t\t\ty = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;\n\n\t\tif ( !this.options.ignoreBoundaries ) {\n\t\t\tif ( x < this.minBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth + x, 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t}\n\t\t\t\tx = this.minBoundaryX;\n\t\t\t} else if ( x > this.maxBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t\tx = this.maxPosX + this.indicatorWidth - this.width;\n\t\t\t\t} else {\n\t\t\t\t\tx = this.maxBoundaryX;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {\n\t\t\t\tthis.width = this.indicatorWidth;\n\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t}\n\n\t\t\tif ( y < this.minBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight + y * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t}\n\t\t\t\ty = this.minBoundaryY;\n\t\t\t} else if ( y > this.maxBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t\ty = this.maxPosY + this.indicatorHeight - this.height;\n\t\t\t\t} else {\n\t\t\t\t\ty = this.maxBoundaryY;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {\n\t\t\t\tthis.height = this.indicatorHeight;\n\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t}\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tif ( this.scroller.options.useTransform ) {\n\t\t\tthis.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;\n\t\t} else {\n\t\t\tthis.indicatorStyle.left = x + 'px';\n\t\t\tthis.indicatorStyle.top = y + 'px';\n\t\t}\n\t},\n\n\t_pos: function (x, y) {\n\t\tif ( x < 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x > this.maxPosX ) {\n\t\t\tx = this.maxPosX;\n\t\t}\n\n\t\tif ( y < 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y > this.maxPosY ) {\n\t\t\ty = this.maxPosY;\n\t\t}\n\n\t\tx = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;\n\t\ty = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;\n\n\t\tthis.scroller.scrollTo(x, y);\n\t},\n\n\tfade: function (val, hold) {\n\t\tif ( hold && !this.visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(this.fadeTimeout);\n\t\tthis.fadeTimeout = null;\n\n\t\tvar time = val ? 250 : 500,\n\t\t\tdelay = val ? 0 : 300;\n\n\t\tval = val ? '1' : '0';\n\n\t\tthis.wrapperStyle[utils.style.transitionDuration] = time + 'ms';\n\n\t\tthis.fadeTimeout = setTimeout((function (val) {\n\t\t\tthis.wrapperStyle.opacity = val;\n\t\t\tthis.visible = +val;\n\t\t}).bind(this, val), delay);\n\t}\n};\n\nIScroll.utils = utils;\n\nif ( typeof module != 'undefined' && module.exports ) {\n\tmodule.exports = IScroll;\n} else if ( typeof define == 'function' && define.amd ) {\n        define( function () { return IScroll; } );\n} else {\n\twindow.IScroll = IScroll;\n}\n\n})(window, document, Math);\n"
  },
  {
    "path": "build/iscroll-zoom.js",
    "content": "/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */\n(function (window, document, Math) {\nvar rAF = window.requestAnimationFrame\t||\n\twindow.webkitRequestAnimationFrame\t||\n\twindow.mozRequestAnimationFrame\t\t||\n\twindow.oRequestAnimationFrame\t\t||\n\twindow.msRequestAnimationFrame\t\t||\n\tfunction (callback) { window.setTimeout(callback, 1000 / 60); };\n\nvar utils = (function () {\n\tvar me = {};\n\n\tvar _elementStyle = document.createElement('div').style;\n\tvar _vendor = (function () {\n\t\tvar vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],\n\t\t\ttransform,\n\t\t\ti = 0,\n\t\t\tl = vendors.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\ttransform = vendors[i] + 'ransform';\n\t\t\tif ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);\n\t\t}\n\n\t\treturn false;\n\t})();\n\n\tfunction _prefixStyle (style) {\n\t\tif ( _vendor === false ) return false;\n\t\tif ( _vendor === '' ) return style;\n\t\treturn _vendor + style.charAt(0).toUpperCase() + style.substr(1);\n\t}\n\n\tme.getTime = Date.now || function getTime () { return new Date().getTime(); };\n\n\tme.extend = function (target, obj) {\n\t\tfor ( var i in obj ) {\n\t\t\ttarget[i] = obj[i];\n\t\t}\n\t};\n\n\tme.addEvent = function (el, type, fn, capture) {\n\t\tel.addEventListener(type, fn, !!capture);\n\t};\n\n\tme.removeEvent = function (el, type, fn, capture) {\n\t\tel.removeEventListener(type, fn, !!capture);\n\t};\n\n\tme.prefixPointerEvent = function (pointerEvent) {\n\t\treturn window.MSPointerEvent ?\n\t\t\t'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):\n\t\t\tpointerEvent;\n\t};\n\n\tme.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {\n\t\tvar distance = current - start,\n\t\t\tspeed = Math.abs(distance) / time,\n\t\t\tdestination,\n\t\t\tduration;\n\n\t\tdeceleration = deceleration === undefined ? 0.0006 : deceleration;\n\n\t\tdestination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\n\t\tduration = speed / deceleration;\n\n\t\tif ( destination < lowerMargin ) {\n\t\t\tdestination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\n\t\t\tdistance = Math.abs(destination - current);\n\t\t\tduration = distance / speed;\n\t\t} else if ( destination > 0 ) {\n\t\t\tdestination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\n\t\t\tdistance = Math.abs(current) + destination;\n\t\t\tduration = distance / speed;\n\t\t}\n\n\t\treturn {\n\t\t\tdestination: Math.round(destination),\n\t\t\tduration: duration\n\t\t};\n\t};\n\n\tvar _transform = _prefixStyle('transform');\n\n\tme.extend(me, {\n\t\thasTransform: _transform !== false,\n\t\thasPerspective: _prefixStyle('perspective') in _elementStyle,\n\t\thasTouch: 'ontouchstart' in window,\n\t\thasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed\n\t\thasTransition: _prefixStyle('transition') in _elementStyle\n\t});\n\n\t/*\n\tThis should find all Android browsers lower than build 535.19 (both stock browser and webview)\n\t- galaxy S2 is ok\n    - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`\n    - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S3 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S4 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S5 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n   - galaxy S6 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n  */\n\tme.isBadAndroid = (function() {\n\t\tvar appVersion = window.navigator.appVersion;\n\t\t// Android browser is not a chrome browser.\n\t\tif (/Android/.test(appVersion) && !(/Chrome\\/\\d/.test(appVersion))) {\n\t\t\tvar safariVersion = appVersion.match(/Safari\\/(\\d+.\\d)/);\n\t\t\tif(safariVersion && typeof safariVersion === \"object\" && safariVersion.length >= 2) {\n\t\t\t\treturn parseFloat(safariVersion[1]) < 535.19;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\tme.extend(me.style = {}, {\n\t\ttransform: _transform,\n\t\ttransitionTimingFunction: _prefixStyle('transitionTimingFunction'),\n\t\ttransitionDuration: _prefixStyle('transitionDuration'),\n\t\ttransitionDelay: _prefixStyle('transitionDelay'),\n\t\ttransformOrigin: _prefixStyle('transformOrigin'),\n\t\ttouchAction: _prefixStyle('touchAction')\n\t});\n\n\tme.hasClass = function (e, c) {\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\");\n\t\treturn re.test(e.className);\n\t};\n\n\tme.addClass = function (e, c) {\n\t\tif ( me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar newclass = e.className.split(' ');\n\t\tnewclass.push(c);\n\t\te.className = newclass.join(' ');\n\t};\n\n\tme.removeClass = function (e, c) {\n\t\tif ( !me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\", 'g');\n\t\te.className = e.className.replace(re, ' ');\n\t};\n\n\tme.offset = function (el) {\n\t\tvar left = -el.offsetLeft,\n\t\t\ttop = -el.offsetTop;\n\n\t\t// jshint -W084\n\t\twhile (el = el.offsetParent) {\n\t\t\tleft -= el.offsetLeft;\n\t\t\ttop -= el.offsetTop;\n\t\t}\n\t\t// jshint +W084\n\n\t\treturn {\n\t\t\tleft: left,\n\t\t\ttop: top\n\t\t};\n\t};\n\n\tme.preventDefaultException = function (el, exceptions) {\n\t\tfor ( var i in exceptions ) {\n\t\t\tif ( exceptions[i].test(el[i]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tme.extend(me.eventType = {}, {\n\t\ttouchstart: 1,\n\t\ttouchmove: 1,\n\t\ttouchend: 1,\n\n\t\tmousedown: 2,\n\t\tmousemove: 2,\n\t\tmouseup: 2,\n\n\t\tpointerdown: 3,\n\t\tpointermove: 3,\n\t\tpointerup: 3,\n\n\t\tMSPointerDown: 3,\n\t\tMSPointerMove: 3,\n\t\tMSPointerUp: 3\n\t});\n\n\tme.extend(me.ease = {}, {\n\t\tquadratic: {\n\t\t\tstyle: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n\t\t\tfn: function (k) {\n\t\t\t\treturn k * ( 2 - k );\n\t\t\t}\n\t\t},\n\t\tcircular: {\n\t\t\tstyle: 'cubic-bezier(0.1, 0.57, 0.1, 1)',\t// Not properly \"circular\" but this looks better, it should be (0.075, 0.82, 0.165, 1)\n\t\t\tfn: function (k) {\n\t\t\t\treturn Math.sqrt( 1 - ( --k * k ) );\n\t\t\t}\n\t\t},\n\t\tback: {\n\t\t\tstyle: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n\t\t\tfn: function (k) {\n\t\t\t\tvar b = 4;\n\t\t\t\treturn ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;\n\t\t\t}\n\t\t},\n\t\tbounce: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tif ( ( k /= 1 ) < ( 1 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * k * k;\n\t\t\t\t} else if ( k < ( 2 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n\t\t\t\t} else if ( k < ( 2.5 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n\t\t\t\t} else {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\telastic: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tvar f = 0.22,\n\t\t\t\t\te = 0.4;\n\n\t\t\t\tif ( k === 0 ) { return 0; }\n\t\t\t\tif ( k == 1 ) { return 1; }\n\n\t\t\t\treturn ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );\n\t\t\t}\n\t\t}\n\t});\n\n\tme.tap = function (e, eventName) {\n\t\tvar ev = document.createEvent('Event');\n\t\tev.initEvent(eventName, true, true);\n\t\tev.pageX = e.pageX;\n\t\tev.pageY = e.pageY;\n\t\te.target.dispatchEvent(ev);\n\t};\n\n\tme.click = function (e) {\n\t\tvar target = e.target,\n\t\t\tev;\n\n\t\tif ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n\t\t\t// initMouseEvent is deprecated.\n\t\t\tev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');\n\t\t\tev.initEvent('click', true, true);\n\t\t\tev.view = e.view || window;\n\t\t\tev.detail = 1;\n\t\t\tev.screenX = target.screenX || 0;\n\t\t\tev.screenY = target.screenY || 0;\n\t\t\tev.clientX = target.clientX || 0;\n\t\t\tev.clientY = target.clientY || 0;\n\t\t\tev.ctrlKey = !!e.ctrlKey;\n\t\t\tev.altKey = !!e.altKey;\n\t\t\tev.shiftKey = !!e.shiftKey;\n\t\t\tev.metaKey = !!e.metaKey;\n\t\t\tev.button = 0;\n\t\t\tev.relatedTarget = null;\n\t\t\tev._constructed = true;\n\t\t\ttarget.dispatchEvent(ev);\n\t\t}\n\t};\n\n\tme.getTouchAction = function(eventPassthrough, addPinch) {\n\t\tvar touchAction = 'none';\n\t\tif ( eventPassthrough === 'vertical' ) {\n\t\t\ttouchAction = 'pan-y';\n\t\t} else if (eventPassthrough === 'horizontal' ) {\n\t\t\ttouchAction = 'pan-x';\n\t\t}\n\t\tif (addPinch && touchAction != 'none') {\n\t\t\t// add pinch-zoom support if the browser supports it, but if not (eg. Chrome <55) do nothing\n\t\t\ttouchAction += ' pinch-zoom';\n\t\t}\n\t\treturn touchAction;\n\t};\n\n\tme.getRect = function(el) {\n\t\tif (el instanceof SVGElement) {\n\t\t\tvar rect = el.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop : rect.top,\n\t\t\t\tleft : rect.left,\n\t\t\t\twidth : rect.width,\n\t\t\t\theight : rect.height\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttop : el.offsetTop,\n\t\t\t\tleft : el.offsetLeft,\n\t\t\t\twidth : el.offsetWidth,\n\t\t\t\theight : el.offsetHeight\n\t\t\t};\n\t\t}\n\t};\n\n\treturn me;\n})();\nfunction IScroll (el, options) {\n\tthis.wrapper = typeof el == 'string' ? document.querySelector(el) : el;\n\tthis.scroller = this.wrapper.children[0];\n\tthis.scrollerStyle = this.scroller.style;\t\t// cache style for better performance\n\n\tthis.options = {\n\n\t\tzoomMin: 1,\n\t\tzoomMax: 4, startZoom: 1,\n\n\t\tresizeScrollbars: true,\n\n\t\tmouseWheelSpeed: 20,\n\n\t\tsnapThreshold: 0.334,\n\n// INSERT POINT: OPTIONS\n\t\tdisablePointer : !utils.hasPointer,\n\t\tdisableTouch : utils.hasPointer || !utils.hasTouch,\n\t\tdisableMouse : utils.hasPointer || utils.hasTouch,\n\t\tstartX: 0,\n\t\tstartY: 0,\n\t\tscrollY: true,\n\t\tdirectionLockThreshold: 5,\n\t\tmomentum: true,\n\n\t\tbounce: true,\n\t\tbounceTime: 600,\n\t\tbounceEasing: '',\n\n\t\tpreventDefault: true,\n\t\tpreventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },\n\n\t\tHWCompositing: true,\n\t\tuseTransition: true,\n\t\tuseTransform: true,\n\t\tbindToWrapper: typeof window.onmousedown === \"undefined\"\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\t// Normalize options\n\tthis.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';\n\n\tthis.options.useTransition = utils.hasTransition && this.options.useTransition;\n\tthis.options.useTransform = utils.hasTransform && this.options.useTransform;\n\n\tthis.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;\n\tthis.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;\n\n\t// If you want eventPassthrough I have to lock one of the axes\n\tthis.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;\n\tthis.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;\n\n\t// With eventPassthrough we also need lockDirection mechanism\n\tthis.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;\n\tthis.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;\n\n\tthis.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;\n\n\tthis.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;\n\n\tif ( this.options.tap === true ) {\n\t\tthis.options.tap = 'tap';\n\t}\n\n\t// https://github.com/cubiq/iscroll/issues/1029\n\tif (!this.options.useTransition && !this.options.useTransform) {\n\t\tif(!(/relative|absolute/i).test(this.scrollerStyle.position)) {\n\t\t\tthis.scrollerStyle.position = \"relative\";\n\t\t}\n\t}\n\n\tif ( this.options.shrinkScrollbars == 'scale' ) {\n\t\tthis.options.useTransition = false;\n\t}\n\n\tthis.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;\n\n// INSERT POINT: NORMALIZATION\n\n\t// Some defaults\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.directionX = 0;\n\tthis.directionY = 0;\n\tthis._events = {};\n\n\tthis.scale = Math.min(Math.max(this.options.startZoom, this.options.zoomMin), this.options.zoomMax);\n\n// INSERT POINT: DEFAULTS\n\n\tthis._init();\n\tthis.refresh();\n\n\tthis.scrollTo(this.options.startX, this.options.startY);\n\tthis.enable();\n}\n\nIScroll.prototype = {\n\tversion: '5.2.0-snapshot',\n\n\t_init: function () {\n\t\tthis._initEvents();\n\n\t\tif ( this.options.zoom ) {\n\t\t\tthis._initZoom();\n\t\t}\n\n\t\tif ( this.options.scrollbars || this.options.indicators ) {\n\t\t\tthis._initIndicators();\n\t\t}\n\n\t\tif ( this.options.mouseWheel ) {\n\t\t\tthis._initWheel();\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tthis._initSnap();\n\t\t}\n\n\t\tif ( this.options.keyBindings ) {\n\t\t\tthis._initKeys();\n\t\t}\n\n// INSERT POINT: _init\n\n\t},\n\n\tdestroy: function () {\n\t\tthis._initEvents(true);\n\t\tclearTimeout(this.resizeTimeout);\n \t\tthis.resizeTimeout = null;\n\t\tthis._execEvent('destroy');\n\t},\n\n\t_transitionEnd: function (e) {\n\t\tif ( e.target != this.scroller || !this.isInTransition ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._transitionTime();\n\t\tif ( !this.resetPosition(this.options.bounceTime) ) {\n\t\t\tthis.isInTransition = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\t// React to left mouse button only\n\t\tif ( utils.eventType[e.type] != 1 ) {\n\t\t  // for button property\n\t\t  // http://unixpapa.com/js/mouse.html\n\t\t  var button;\n\t    if (!e.which) {\n\t      /* IE case */\n\t      button = (e.button < 2) ? 0 :\n\t               ((e.button == 4) ? 1 : 2);\n\t    } else {\n\t      /* All others */\n\t      button = e.button;\n\t    }\n\t\t\tif ( button !== 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tpos;\n\n\t\tthis.initiated\t= utils.eventType[e.type];\n\t\tthis.moved\t\t= false;\n\t\tthis.distX\t\t= 0;\n\t\tthis.distY\t\t= 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\tthis.directionLocked = 0;\n\n\t\tthis.startTime = utils.getTime();\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tthis._transitionTime();\n\t\t\tthis.isInTransition = false;\n\t\t\tpos = this.getComputedPosition();\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis._execEvent('scrollEnd');\n\t\t} else if ( !this.options.useTransition && this.isAnimating ) {\n\t\t\tthis.isAnimating = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\n\t\tthis.startX    = this.x;\n\t\tthis.startY    = this.y;\n\t\tthis.absStartX = this.x;\n\t\tthis.absStartY = this.y;\n\t\tthis.pointX    = point.pageX;\n\t\tthis.pointY    = point.pageY;\n\n\t\tthis._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\t// increases performance on Android? TODO: check!\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point\t\t= e.touches ? e.touches[0] : e,\n\t\t\tdeltaX\t\t= point.pageX - this.pointX,\n\t\t\tdeltaY\t\t= point.pageY - this.pointY,\n\t\t\ttimestamp\t= utils.getTime(),\n\t\t\tnewX, newY,\n\t\t\tabsDistX, absDistY;\n\n\t\tthis.pointX\t\t= point.pageX;\n\t\tthis.pointY\t\t= point.pageY;\n\n\t\tthis.distX\t\t+= deltaX;\n\t\tthis.distY\t\t+= deltaY;\n\t\tabsDistX\t\t= Math.abs(this.distX);\n\t\tabsDistY\t\t= Math.abs(this.distY);\n\n\t\t// We need to move at least 10 pixels for the scrolling to initiate\n\t\tif ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If you are scrolling in one direction lock the other\n\t\tif ( !this.directionLocked && !this.options.freeScroll ) {\n\t\t\tif ( absDistX > absDistY + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'h';\t\t// lock horizontally\n\t\t\t} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'v';\t\t// lock vertically\n\t\t\t} else {\n\t\t\t\tthis.directionLocked = 'n';\t\t// no lock\n\t\t\t}\n\t\t}\n\n\t\tif ( this.directionLocked == 'h' ) {\n\t\t\tif ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaY = 0;\n\t\t} else if ( this.directionLocked == 'v' ) {\n\t\t\tif ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaX = 0;\n\t\t}\n\n\t\tdeltaX = this.hasHorizontalScroll ? deltaX : 0;\n\t\tdeltaY = this.hasVerticalScroll ? deltaY : 0;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\t// Slow down if outside of the boundaries\n\t\tif ( newX > 0 || newX < this.maxScrollX ) {\n\t\t\tnewX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;\n\t\t}\n\t\tif ( newY > 0 || newY < this.maxScrollY ) {\n\t\t\tnewY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;\n\t\t}\n\n\t\tthis.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;\n\t\tthis.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;\n\n\t\tif ( !this.moved ) {\n\t\t\tthis._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tthis._translate(newX, newY);\n\n/* REPLACE START: _move */\n\n\t\tif ( timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.startX = this.x;\n\t\t\tthis.startY = this.y;\n\t\t}\n\n/* REPLACE END: _move */\n\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.changedTouches ? e.changedTouches[0] : e,\n\t\t\tmomentumX,\n\t\t\tmomentumY,\n\t\t\tduration = utils.getTime() - this.startTime,\n\t\t\tnewX = Math.round(this.x),\n\t\t\tnewY = Math.round(this.y),\n\t\t\tdistanceX = Math.abs(newX - this.startX),\n\t\t\tdistanceY = Math.abs(newY - this.startY),\n\t\t\ttime = 0,\n\t\t\teasing = '';\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\t\tthis.endTime = utils.getTime();\n\n\t\t// reset if we are outside of the boundaries\n\t\tif ( this.resetPosition(this.options.bounceTime) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY);\t// ensures that the last position is rounded\n\n\t\t// we scrolled less than 10 pixels\n\t\tif ( !this.moved ) {\n\t\t\tif ( this.options.tap ) {\n\t\t\t\tutils.tap(e, this.options.tap);\n\t\t\t}\n\n\t\t\tif ( this.options.click ) {\n\t\t\t\tutils.click(e);\n\t\t\t}\n\n\t\t\tthis._execEvent('scrollCancel');\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {\n\t\t\tthis._execEvent('flick');\n\t\t\treturn;\n\t\t}\n\n\t\t// start momentum animation if needed\n\t\tif ( this.options.momentum && duration < 300 ) {\n\t\t\tmomentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };\n\t\t\tmomentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };\n\t\t\tnewX = momentumX.destination;\n\t\t\tnewY = momentumY.destination;\n\t\t\ttime = Math.max(momentumX.duration, momentumY.duration);\n\t\t\tthis.isInTransition = 1;\n\t\t}\n\n\n\t\tif ( this.options.snap ) {\n\t\t\tvar snap = this._nearestSnap(newX, newY);\n\t\t\tthis.currentPage = snap;\n\t\t\ttime = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(newX - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(newY - snap.y), 1000)\n\t\t\t\t\t), 300);\n\t\t\tnewX = snap.x;\n\t\t\tnewY = snap.y;\n\n\t\t\tthis.directionX = 0;\n\t\t\tthis.directionY = 0;\n\t\t\teasing = this.options.bounceEasing;\n\t\t}\n\n// INSERT POINT: _end\n\n\t\tif ( newX != this.x || newY != this.y ) {\n\t\t\t// change easing function when scroller goes out of the boundaries\n\t\t\tif ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {\n\t\t\t\teasing = utils.ease.quadratic;\n\t\t\t}\n\n\t\t\tthis.scrollTo(newX, newY, time, easing);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._execEvent('scrollEnd');\n\t},\n\n\t_resize: function () {\n\t\tvar that = this;\n\n\t\tclearTimeout(this.resizeTimeout);\n\n\t\tthis.resizeTimeout = setTimeout(function () {\n\t\t\tthat.refresh();\n\t\t}, this.options.resizePolling);\n\t},\n\n\tresetPosition: function (time) {\n\t\tvar x = this.x,\n\t\t\ty = this.y;\n\n\t\ttime = time || 0;\n\n\t\tif ( !this.hasHorizontalScroll || this.x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( this.x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll || this.y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( this.y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tif ( x == this.x && y == this.y ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time, this.options.bounceEasing);\n\n\t\treturn true;\n\t},\n\n\tdisable: function () {\n\t\tthis.enabled = false;\n\t},\n\n\tenable: function () {\n\t\tthis.enabled = true;\n\t},\n\n\trefresh: function () {\n\t\tutils.getRect(this.wrapper);\t\t// Force reflow\n\n\t\tthis.wrapperWidth\t= this.wrapper.clientWidth;\n\t\tthis.wrapperHeight\t= this.wrapper.clientHeight;\n\n\t\tvar rect = utils.getRect(this.scroller);\n/* REPLACE START: refresh */\n\tthis.scrollerWidth\t= Math.round(rect.width * this.scale);\n\tthis.scrollerHeight\t= Math.round(rect.height * this.scale);\n\n\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\tthis.maxScrollY\t\t= this.wrapperHeight - this.scrollerHeight;\n/* REPLACE END: refresh */\n\n\t\tthis.hasHorizontalScroll\t= this.options.scrollX && this.maxScrollX < 0;\n\t\tthis.hasVerticalScroll\t\t= this.options.scrollY && this.maxScrollY < 0;\n\t\t\n\t\tif ( !this.hasHorizontalScroll ) {\n\t\t\tthis.maxScrollX = 0;\n\t\t\tthis.scrollerWidth = this.wrapperWidth;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\tthis.maxScrollY = 0;\n\t\t\tthis.scrollerHeight = this.wrapperHeight;\n\t\t}\n\n\t\tthis.endTime = 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\t\n\t\tif(utils.hasPointer && !this.options.disablePointer) {\n\t\t\t// The wrapper should have `touchAction` property for using pointerEvent.\n\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, true);\n\n\t\t\t// case. not support 'pinch-zoom'\n\t\t\t// https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583\n\t\t\tif (!this.wrapper.style[utils.style.touchAction]) {\n\t\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, false);\n\t\t\t}\n\t\t}\n\t\tthis.wrapperOffset = utils.offset(this.wrapper);\n\n\t\tthis._execEvent('refresh');\n\n\t\tthis.resetPosition();\n\n// INSERT POINT: _refresh\n\n\t},\t\n\n\ton: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\tthis._events[type] = [];\n\t\t}\n\n\t\tthis._events[type].push(fn);\n\t},\n\n\toff: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar index = this._events[type].indexOf(fn);\n\n\t\tif ( index > -1 ) {\n\t\t\tthis._events[type].splice(index, 1);\n\t\t}\n\t},\n\n\t_execEvent: function (type) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this._events[type].length;\n\n\t\tif ( !l ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tthis._events[type][i].apply(this, [].slice.call(arguments, 1));\n\t\t}\n\t},\n\n\tscrollBy: function (x, y, time, easing) {\n\t\tx = this.x + x;\n\t\ty = this.y + y;\n\t\ttime = time || 0;\n\n\t\tthis.scrollTo(x, y, time, easing);\n\t},\n\n\tscrollTo: function (x, y, time, easing) {\n\t\teasing = easing || utils.ease.circular;\n\n\t\tthis.isInTransition = this.options.useTransition && time > 0;\n\t\tvar transitionType = this.options.useTransition && easing.style;\n\t\tif ( !time || transitionType ) {\n\t\t\t\tif(transitionType) {\n\t\t\t\t\tthis._transitionTimingFunction(easing.style);\n\t\t\t\t\tthis._transitionTime(time);\n\t\t\t\t}\n\t\t\tthis._translate(x, y);\n\t\t} else {\n\t\t\tthis._animate(x, y, time, easing.fn);\n\t\t}\n\t},\n\n\tscrollToElement: function (el, time, offsetX, offsetY, easing) {\n\t\tel = el.nodeType ? el : this.scroller.querySelector(el);\n\n\t\tif ( !el ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar pos = utils.offset(el);\n\n\t\tpos.left -= this.wrapperOffset.left;\n\t\tpos.top  -= this.wrapperOffset.top;\n\n\t\t// if offsetX/Y are true we center the element to the screen\n\t\tvar elRect = utils.getRect(el);\n\t\tvar wrapperRect = utils.getRect(this.wrapper);\n\t\tif ( offsetX === true ) {\n\t\t\toffsetX = Math.round(elRect.width / 2 - wrapperRect.width / 2);\n\t\t}\n\t\tif ( offsetY === true ) {\n\t\t\toffsetY = Math.round(elRect.height / 2 - wrapperRect.height / 2);\n\t\t}\n\n\t\tpos.left -= offsetX || 0;\n\t\tpos.top  -= offsetY || 0;\n\n\t\tpos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;\n\t\tpos.top  = pos.top  > 0 ? 0 : pos.top  < this.maxScrollY ? this.maxScrollY : pos.top;\n\n\t\ttime = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;\n\n\t\tthis.scrollTo(pos.left, pos.top, time, easing);\n\t},\n\n\t_transitionTime: function (time) {\n\t\tif (!this.options.useTransition) {\n\t\t\treturn;\n\t\t}\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollerStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.scrollerStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.scrollerStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.scrollerStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTime(time);\n\t\t\t}\n\t\t}\n\n\n// INSERT POINT: _transitionTime\n\n\t},\n\n\t_transitionTimingFunction: function (easing) {\n\t\tthis.scrollerStyle[utils.style.transitionTimingFunction] = easing;\n\n\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTimingFunction(easing);\n\t\t\t}\n\t\t}\n\n\n// INSERT POINT: _transitionTimingFunction\n\n\t},\n\n\t_translate: function (x, y) {\n\t\tif ( this.options.useTransform ) {\n\n/* REPLACE START: _translate */\t\t\tthis.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px) scale(' + this.scale + ') ' + this.translateZ;/* REPLACE END: _translate */\n\n\t\t} else {\n\t\t\tx = Math.round(x);\n\t\t\ty = Math.round(y);\n\t\t\tthis.scrollerStyle.left = x + 'px';\n\t\t\tthis.scrollerStyle.top = y + 'px';\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\n\tif ( this.indicators ) {\n\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\tthis.indicators[i].updatePosition();\n\t\t}\n\t}\n\n\n// INSERT POINT: _translate\n\n\t},\n\n\t_initEvents: function (remove) {\n\t\tvar eventType = remove ? utils.removeEvent : utils.addEvent,\n\t\t\ttarget = this.options.bindToWrapper ? this.wrapper : window;\n\n\t\teventType(window, 'orientationchange', this);\n\t\teventType(window, 'resize', this);\n\n\t\tif ( this.options.click ) {\n\t\t\teventType(this.wrapper, 'click', this, true);\n\t\t}\n\n\t\tif ( !this.options.disableMouse ) {\n\t\t\teventType(this.wrapper, 'mousedown', this);\n\t\t\teventType(target, 'mousemove', this);\n\t\t\teventType(target, 'mousecancel', this);\n\t\t\teventType(target, 'mouseup', this);\n\t\t}\n\n\t\tif ( utils.hasPointer && !this.options.disablePointer ) {\n\t\t\teventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointermove'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointercancel'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\n\t\tif ( utils.hasTouch && !this.options.disableTouch ) {\n\t\t\teventType(this.wrapper, 'touchstart', this);\n\t\t\teventType(target, 'touchmove', this);\n\t\t\teventType(target, 'touchcancel', this);\n\t\t\teventType(target, 'touchend', this);\n\t\t}\n\n\t\teventType(this.scroller, 'transitionend', this);\n\t\teventType(this.scroller, 'webkitTransitionEnd', this);\n\t\teventType(this.scroller, 'oTransitionEnd', this);\n\t\teventType(this.scroller, 'MSTransitionEnd', this);\n\t},\n\n\tgetComputedPosition: function () {\n\t\tvar matrix = window.getComputedStyle(this.scroller, null),\n\t\t\tx, y;\n\n\t\tif ( this.options.useTransform ) {\n\t\t\tmatrix = matrix[utils.style.transform].split(')')[0].split(', ');\n\t\t\tx = +(matrix[12] || matrix[4]);\n\t\t\ty = +(matrix[13] || matrix[5]);\n\t\t} else {\n\t\t\tx = +matrix.left.replace(/[^-\\d.]/g, '');\n\t\t\ty = +matrix.top.replace(/[^-\\d.]/g, '');\n\t\t}\n\n\t\treturn { x: x, y: y };\n\t},\n\t_initIndicators: function () {\n\t\tvar interactive = this.options.interactiveScrollbars,\n\t\t\tcustomStyle = typeof this.options.scrollbars != 'string',\n\t\t\tindicators = [],\n\t\t\tindicator;\n\n\t\tvar that = this;\n\n\t\tthis.indicators = [];\n\n\t\tif ( this.options.scrollbars ) {\n\t\t\t// Vertical scrollbar\n\t\t\tif ( this.options.scrollY ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('v', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenX: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\n\t\t\t// Horizontal scrollbar\n\t\t\tif ( this.options.scrollX ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('h', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenY: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.indicators ) {\n\t\t\t// TODO: check concat compatibility\n\t\t\tindicators = indicators.concat(this.options.indicators);\n\t\t}\n\n\t\tfor ( var i = indicators.length; i--; ) {\n\t\t\tthis.indicators.push( new Indicator(this, indicators[i]) );\n\t\t}\n\n\t\t// TODO: check if we can use array.map (wide compatibility and performance issues)\n\t\tfunction _indicatorsMap (fn) {\n\t\t\tif (that.indicators) {\n\t\t\t\tfor ( var i = that.indicators.length; i--; ) {\n\t\t\t\t\tfn.call(that.indicators[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tthis.on('scrollEnd', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollCancel', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('beforeScrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1, true);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\n\t\tthis.on('refresh', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.refresh();\n\t\t\t});\n\t\t});\n\n\t\tthis.on('destroy', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.destroy();\n\t\t\t});\n\n\t\t\tdelete this.indicators;\n\t\t});\n\t},\n\n\t_initZoom: function () {\n\t\tthis.scrollerStyle[utils.style.transformOrigin] = '0 0';\n\t},\n\n\t_zoomStart: function (e) {\n\t\tvar c1 = Math.abs( e.touches[0].pageX - e.touches[1].pageX ),\n\t\t\tc2 = Math.abs( e.touches[0].pageY - e.touches[1].pageY );\n\n\t\tthis.touchesDistanceStart = Math.sqrt(c1 * c1 + c2 * c2);\n\t\tthis.startScale = this.scale;\n\n\t\tthis.originX = Math.abs(e.touches[0].pageX + e.touches[1].pageX) / 2 + this.wrapperOffset.left - this.x;\n\t\tthis.originY = Math.abs(e.touches[0].pageY + e.touches[1].pageY) / 2 + this.wrapperOffset.top - this.y;\n\n\t\tthis._execEvent('zoomStart');\n\t},\n\n\t_zoom: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar c1 = Math.abs( e.touches[0].pageX - e.touches[1].pageX ),\n\t\t\tc2 = Math.abs( e.touches[0].pageY - e.touches[1].pageY ),\n\t\t\tdistance = Math.sqrt( c1 * c1 + c2 * c2 ),\n\t\t\tscale = 1 / this.touchesDistanceStart * distance * this.startScale,\n\t\t\tlastScale,\n\t\t\tx, y;\n\n\t\tthis.scaled = true;\n\n\t\tif ( scale < this.options.zoomMin ) {\n\t\t\tscale = 0.5 * this.options.zoomMin * Math.pow(2.0, scale / this.options.zoomMin);\n\t\t} else if ( scale > this.options.zoomMax ) {\n\t\t\tscale = 2.0 * this.options.zoomMax * Math.pow(0.5, this.options.zoomMax / scale);\n\t\t}\n\n\t\tlastScale = scale / this.startScale;\n\t\tx = this.originX - this.originX * lastScale + this.startX;\n\t\ty = this.originY - this.originY * lastScale + this.startY;\n\n\t\tthis.scale = scale;\n\n\t\tthis.scrollTo(x, y, 0);\n\t},\n\n\t_zoomEnd: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar newX, newY,\n\t\t\tlastScale;\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\n\t\tif ( this.scale > this.options.zoomMax ) {\n\t\t\tthis.scale = this.options.zoomMax;\n\t\t} else if ( this.scale < this.options.zoomMin ) {\n\t\t\tthis.scale = this.options.zoomMin;\n\t\t}\n\n\t\t// Update boundaries\n\t\tthis.refresh();\n\n\t\tlastScale = this.scale / this.startScale;\n\n\t\tnewX = this.originX - this.originX * lastScale + this.startX;\n\t\tnewY = this.originY - this.originY * lastScale + this.startY;\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t}\n\n\t\tif ( this.x != newX || this.y != newY ) {\n\t\t\tthis.scrollTo(newX, newY, this.options.bounceTime);\n\t\t}\n\n\t\tthis.scaled = false;\n\n\t\tthis._execEvent('zoomEnd');\n\t},\n\n\tzoom: function (scale, x, y, time) {\n\t\tif ( scale < this.options.zoomMin ) {\n\t\t\tscale = this.options.zoomMin;\n\t\t} else if ( scale > this.options.zoomMax ) {\n\t\t\tscale = this.options.zoomMax;\n\t\t}\n\n\t\tif ( scale == this.scale ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar relScale = scale / this.scale;\n\n\t\tx = x === undefined ? this.wrapperWidth / 2 : x;\n\t\ty = y === undefined ? this.wrapperHeight / 2 : y;\n\t\ttime = time === undefined ? 300 : time;\n\n\t\tx = x + this.wrapperOffset.left - this.x;\n\t\ty = y + this.wrapperOffset.top - this.y;\n\n\t\tx = x - x * relScale + this.x;\n\t\ty = y - y * relScale + this.y;\n\n\t\tthis.scale = scale;\n\n\t\tthis.refresh();\t\t// update boundaries\n\n\t\tif ( x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time);\n\t},\n\n\t_wheelZoom: function (e) {\n\t\tvar wheelDeltaY,\n\t\t\tdeltaScale,\n\t\t\tthat = this;\n\n\t\t// Execute the zoomEnd event after 400ms the wheel stopped scrolling\n\t\tclearTimeout(this.wheelTimeout);\n\t\tthis.wheelTimeout = setTimeout(function () {\n\t\t\tthat._execEvent('zoomEnd');\n\t\t}, 400);\n\n\t\tif ( 'deltaX' in e ) {\n\t\t\twheelDeltaY = -e.deltaY / Math.abs(e.deltaY);\n\t\t} else if ('wheelDeltaX' in e) {\n\t\t\twheelDeltaY = e.wheelDeltaY / Math.abs(e.wheelDeltaY);\n\t\t} else if('wheelDelta' in e) {\n\t\t\twheelDeltaY = e.wheelDelta / Math.abs(e.wheelDelta);\n\t\t} else if ('detail' in e) {\n\t\t\twheelDeltaY = -e.detail / Math.abs(e.wheelDelta);\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tdeltaScale = this.scale + wheelDeltaY / 5;\n\n\t\tthis.zoom(deltaScale, e.pageX, e.pageY, 0);\n\t},\n\n\t_initWheel: function () {\n\t\tutils.addEvent(this.wrapper, 'wheel', this);\n\t\tutils.addEvent(this.wrapper, 'mousewheel', this);\n\t\tutils.addEvent(this.wrapper, 'DOMMouseScroll', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tclearTimeout(this.wheelTimeout);\n\t\t\tthis.wheelTimeout = null;\n\t\t\tutils.removeEvent(this.wrapper, 'wheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'mousewheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'DOMMouseScroll', this);\n\t\t});\n\t},\n\n\t_wheel: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tvar wheelDeltaX, wheelDeltaY,\n\t\t\tnewX, newY,\n\t\t\tthat = this;\n\n\t\tif ( this.wheelTimeout === undefined ) {\n\t\t\tthat._execEvent('scrollStart');\n\t\t}\n\n\t\t// Execute the scrollEnd event after 400ms the wheel stopped scrolling\n\t\tclearTimeout(this.wheelTimeout);\n\t\tthis.wheelTimeout = setTimeout(function () {\n\t\t\tif(!that.options.snap) {\n\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t}\n\t\t\tthat.wheelTimeout = undefined;\n\t\t}, 400);\n\n\t\tif ( 'deltaX' in e ) {\n\t\t\tif (e.deltaMode === 1) {\n\t\t\t\twheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;\n\t\t\t\twheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;\n\t\t\t} else {\n\t\t\t\twheelDeltaX = -e.deltaX;\n\t\t\t\twheelDeltaY = -e.deltaY;\n\t\t\t}\n\t\t} else if ( 'wheelDeltaX' in e ) {\n\t\t\twheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;\n\t\t\twheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'wheelDelta' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'detail' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\twheelDeltaX *= this.options.invertWheelDirection;\n\t\twheelDeltaY *= this.options.invertWheelDirection;\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\twheelDeltaX = wheelDeltaY;\n\t\t\twheelDeltaY = 0;\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tnewX = this.currentPage.pageX;\n\t\t\tnewY = this.currentPage.pageY;\n\n\t\t\tif ( wheelDeltaX > 0 ) {\n\t\t\t\tnewX--;\n\t\t\t} else if ( wheelDeltaX < 0 ) {\n\t\t\t\tnewX++;\n\t\t\t}\n\n\t\t\tif ( wheelDeltaY > 0 ) {\n\t\t\t\tnewY--;\n\t\t\t} else if ( wheelDeltaY < 0 ) {\n\t\t\t\tnewY++;\n\t\t\t}\n\n\t\t\tthis.goToPage(newX, newY);\n\n\t\t\treturn;\n\t\t}\n\n\t\tnewX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);\n\t\tnewY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);\n\n\t\tthis.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;\n\t\tthis.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n// INSERT POINT: _wheel\n\t},\n\n\t_initSnap: function () {\n\t\tthis.currentPage = {};\n\n\t\tif ( typeof this.options.snap == 'string' ) {\n\t\t\tthis.options.snap = this.scroller.querySelectorAll(this.options.snap);\n\t\t}\n\n\t\tthis.on('refresh', function () {\n\t\t\tvar i = 0, l,\n\t\t\t\tm = 0, n,\n\t\t\t\tcx, cy,\n\t\t\t\tx = 0, y,\n\t\t\t\tstepX = this.options.snapStepX || this.wrapperWidth,\n\t\t\t\tstepY = this.options.snapStepY || this.wrapperHeight,\n\t\t\t\tel,\n\t\t\t\trect;\n\n\t\t\tthis.pages = [];\n\n\t\t\tif ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.options.snap === true ) {\n\t\t\t\tcx = Math.round( stepX / 2 );\n\t\t\t\tcy = Math.round( stepY / 2 );\n\n\t\t\t\twhile ( x > -this.scrollerWidth ) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile ( y > -this.scrollerHeight ) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tel = this.options.snap;\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\trect = utils.getRect(el[i]);\n\t\t\t\t\tif ( i === 0 || rect.left <= utils.getRect(el[i-1]).left ) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !this.pages[m] ) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( x > this.maxScrollX ) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);\n\n\t\t\t// Update snap threshold if needed\n\t\t\tif ( this.options.snapThreshold % 1 === 0 ) {\n\t\t\t\tthis.snapThresholdX = this.options.snapThreshold;\n\t\t\t\tthis.snapThresholdY = this.options.snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('flick', function () {\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tthis.goToPage(\n\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\ttime\n\t\t\t);\n\t\t});\n\t},\n\n\t_nearestSnap: function (x, y) {\n\t\tif ( !this.pages.length ) {\n\t\t\treturn { x: 0, y: 0, pageX: 0, pageY: 0 };\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this.pages.length,\n\t\t\tm = 0;\n\n\t\t// Check if we exceeded the snap threshold\n\t\tif ( Math.abs(x - this.absStartX) < this.snapThresholdX &&\n\t\t\tMath.abs(y - this.absStartY) < this.snapThresholdY ) {\n\t\t\treturn this.currentPage;\n\t\t}\n\n\t\tif ( x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( x >= this.pages[i][0].cx ) {\n\t\t\t\tx = this.pages[i][0].x;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tl = this.pages[i].length;\n\n\t\tfor ( ; m < l; m++ ) {\n\t\t\tif ( y >= this.pages[0][m].cy ) {\n\t\t\t\ty = this.pages[0][m].y;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( i == this.currentPage.pageX ) {\n\t\t\ti += this.directionX;\n\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t} else if ( i >= this.pages.length ) {\n\t\t\t\ti = this.pages.length - 1;\n\t\t\t}\n\n\t\t\tx = this.pages[i][0].x;\n\t\t}\n\n\t\tif ( m == this.currentPage.pageY ) {\n\t\t\tm += this.directionY;\n\n\t\t\tif ( m < 0 ) {\n\t\t\t\tm = 0;\n\t\t\t} else if ( m >= this.pages[0].length ) {\n\t\t\t\tm = this.pages[0].length - 1;\n\t\t\t}\n\n\t\t\ty = this.pages[0][m].y;\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tpageX: i,\n\t\t\tpageY: m\n\t\t};\n\t},\n\n\tgoToPage: function (x, y, time, easing) {\n\t\teasing = easing || this.options.bounceEasing;\n\n\t\tif ( x >= this.pages.length ) {\n\t\t\tx = this.pages.length - 1;\n\t\t} else if ( x < 0 ) {\n\t\t\tx = 0;\n\t\t}\n\n\t\tif ( y >= this.pages[x].length ) {\n\t\t\ty = this.pages[x].length - 1;\n\t\t} else if ( y < 0 ) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tvar posX = this.pages[x][y].x,\n\t\t\tposY = this.pages[x][y].y;\n\n\t\ttime = time === undefined ? this.options.snapSpeed || Math.max(\n\t\t\tMath.max(\n\t\t\t\tMath.min(Math.abs(posX - this.x), 1000),\n\t\t\t\tMath.min(Math.abs(posY - this.y), 1000)\n\t\t\t), 300) : time;\n\n\t\tthis.currentPage = {\n\t\t\tx: posX,\n\t\t\ty: posY,\n\t\t\tpageX: x,\n\t\t\tpageY: y\n\t\t};\n\n\t\tthis.scrollTo(posX, posY, time, easing);\n\t},\n\n\tnext: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx++;\n\n\t\tif ( x >= this.pages.length && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty++;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\tprev: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx--;\n\n\t\tif ( x < 0 && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty--;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\t_initKeys: function (e) {\n\t\t// default key bindings\n\t\tvar keys = {\n\t\t\tpageUp: 33,\n\t\t\tpageDown: 34,\n\t\t\tend: 35,\n\t\t\thome: 36,\n\t\t\tleft: 37,\n\t\t\tup: 38,\n\t\t\tright: 39,\n\t\t\tdown: 40\n\t\t};\n\t\tvar i;\n\n\t\t// if you give me characters I give you keycode\n\t\tif ( typeof this.options.keyBindings == 'object' ) {\n\t\t\tfor ( i in this.options.keyBindings ) {\n\t\t\t\tif ( typeof this.options.keyBindings[i] == 'string' ) {\n\t\t\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.options.keyBindings = {};\n\t\t}\n\n\t\tfor ( i in keys ) {\n\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];\n\t\t}\n\n\t\tutils.addEvent(window, 'keydown', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tutils.removeEvent(window, 'keydown', this);\n\t\t});\n\t},\n\n\t_key: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar snap = this.options.snap,\t// we are using this alot, better to cache it\n\t\t\tnewX = snap ? this.currentPage.pageX : this.x,\n\t\t\tnewY = snap ? this.currentPage.pageY : this.y,\n\t\t\tnow = utils.getTime(),\n\t\t\tprevTime = this.keyTime || 0,\n\t\t\tacceleration = 0.250,\n\t\t\tpos;\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tpos = this.getComputedPosition();\n\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis.isInTransition = false;\n\t\t}\n\n\t\tthis.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;\n\n\t\tswitch ( e.keyCode ) {\n\t\t\tcase this.options.keyBindings.pageUp:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX += snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY += snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.pageDown:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX -= snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY -= snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.end:\n\t\t\t\tnewX = snap ? this.pages.length-1 : this.maxScrollX;\n\t\t\t\tnewY = snap ? this.pages[0].length-1 : this.maxScrollY;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.home:\n\t\t\t\tnewX = 0;\n\t\t\t\tnewY = 0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.left:\n\t\t\t\tnewX += snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.up:\n\t\t\t\tnewY += snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.right:\n\t\t\t\tnewX -= snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.down:\n\t\t\t\tnewY -= snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ( snap ) {\n\t\t\tthis.goToPage(newX, newY);\n\t\t\treturn;\n\t\t}\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n\t\tthis.keyTime = now;\n\t},\n\n\t_animate: function (destX, destY, duration, easingFn) {\n\t\tvar that = this,\n\t\t\tstartX = this.x,\n\t\t\tstartY = this.y,\n\t\t\tstartTime = utils.getTime(),\n\t\t\tdestTime = startTime + duration;\n\n\t\tfunction step () {\n\t\t\tvar now = utils.getTime(),\n\t\t\t\tnewX, newY,\n\t\t\t\teasing;\n\n\t\t\tif ( now >= destTime ) {\n\t\t\t\tthat.isAnimating = false;\n\t\t\t\tthat._translate(destX, destY);\n\n\t\t\t\tif ( !that.resetPosition(that.options.bounceTime) ) {\n\t\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnow = ( now - startTime ) / duration;\n\t\t\teasing = easingFn(now);\n\t\t\tnewX = ( destX - startX ) * easing + startX;\n\t\t\tnewY = ( destY - startY ) * easing + startY;\n\t\t\tthat._translate(newX, newY);\n\n\t\t\tif ( that.isAnimating ) {\n\t\t\t\trAF(step);\n\t\t\t}\n\t\t}\n\n\t\tthis.isAnimating = true;\n\t\tstep();\n\t},\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\n\t\t\t\tif ( this.options.zoom && e.touches && e.touches.length > 1 ) {\n\t\t\t\t\tthis._zoomStart(e);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tif ( this.options.zoom && e.touches && e.touches[1] ) {\n\t\t\t\t\tthis._zoom(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tif ( this.scaled ) {\n\t\t\t\t\tthis._zoomEnd(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t\tcase 'orientationchange':\n\t\t\tcase 'resize':\n\t\t\t\tthis._resize();\n\t\t\t\tbreak;\n\t\t\tcase 'transitionend':\n\t\t\tcase 'webkitTransitionEnd':\n\t\t\tcase 'oTransitionEnd':\n\t\t\tcase 'MSTransitionEnd':\n\t\t\t\tthis._transitionEnd(e);\n\t\t\t\tbreak;\n\t\t\tcase 'wheel':\n\t\t\tcase 'DOMMouseScroll':\n\t\t\tcase 'mousewheel':\n\t\t\t\tif ( this.options.wheelAction == 'zoom' ) {\n\t\t\t\t\tthis._wheelZoom(e);\n\t\t\t\t\treturn;\t\n\t\t\t\t}\n\t\t\t\tthis._wheel(e);\n\t\t\t\tbreak;\n\t\t\tcase 'keydown':\n\t\t\t\tthis._key(e);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n};\nfunction createDefaultScrollbar (direction, interactive, type) {\n\tvar scrollbar = document.createElement('div'),\n\t\tindicator = document.createElement('div');\n\n\tif ( type === true ) {\n\t\tscrollbar.style.cssText = 'position:absolute;z-index:9999';\n\t\tindicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';\n\t}\n\n\tindicator.className = 'iScrollIndicator';\n\n\tif ( direction == 'h' ) {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';\n\t\t\tindicator.style.height = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollHorizontalScrollbar';\n\t} else {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';\n\t\t\tindicator.style.width = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollVerticalScrollbar';\n\t}\n\n\tscrollbar.style.cssText += ';overflow:hidden';\n\n\tif ( !interactive ) {\n\t\tscrollbar.style.pointerEvents = 'none';\n\t}\n\n\tscrollbar.appendChild(indicator);\n\n\treturn scrollbar;\n}\n\nfunction Indicator (scroller, options) {\n\tthis.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;\n\tthis.wrapperStyle = this.wrapper.style;\n\tthis.indicator = this.wrapper.children[0];\n\tthis.indicatorStyle = this.indicator.style;\n\tthis.scroller = scroller;\n\n\tthis.options = {\n\t\tlistenX: true,\n\t\tlistenY: true,\n\t\tinteractive: false,\n\t\tresize: true,\n\t\tdefaultScrollbars: false,\n\t\tshrink: false,\n\t\tfade: false,\n\t\tspeedRatioX: 0,\n\t\tspeedRatioY: 0\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\tthis.sizeRatioX = 1;\n\tthis.sizeRatioY = 1;\n\tthis.maxPosX = 0;\n\tthis.maxPosY = 0;\n\n\tif ( this.options.interactive ) {\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.addEvent(window, 'touchend', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(this.indicator, 'mousedown', this);\n\t\t\tutils.addEvent(window, 'mouseup', this);\n\t\t}\n\t}\n\n\tif ( this.options.fade ) {\n\t\tthis.wrapperStyle[utils.style.transform] = this.scroller.translateZ;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\t\tthis.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';\n\t\t// remove 0.0001ms\n\t\tvar self = this;\n\t\tif(utils.isBadAndroid) {\n\t\t\trAF(function() {\n\t\t\t\tif(self.wrapperStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.wrapperStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tthis.wrapperStyle.opacity = '0';\n\t}\n}\n\nIndicator.prototype = {\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t}\n\t},\n\n\tdestroy: function () {\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tclearTimeout(this.fadeTimeout);\n\t\t\tthis.fadeTimeout = null;\n\t\t}\n\t\tif ( this.options.interactive ) {\n\t\t\tutils.removeEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.removeEvent(this.indicator, 'mousedown', this);\n\n\t\t\tutils.removeEvent(window, 'touchmove', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\t\tutils.removeEvent(window, 'touchend', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t\tutils.removeEvent(window, 'mouseup', this);\n\t\t}\n\n\t\tif ( this.options.defaultScrollbars && this.wrapper.parentNode ) {\n\t\t\tthis.wrapper.parentNode.removeChild(this.wrapper);\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tthis.transitionTime();\n\n\t\tthis.initiated = true;\n\t\tthis.moved = false;\n\t\tthis.lastPointX\t= point.pageX;\n\t\tthis.lastPointY\t= point.pageY;\n\n\t\tthis.startTime\t= utils.getTime();\n\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(window, 'touchmove', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(window, 'mousemove', this);\n\t\t}\n\n\t\tthis.scroller._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tdeltaX, deltaY,\n\t\t\tnewX, newY,\n\t\t\ttimestamp = utils.getTime();\n\n\t\tif ( !this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tdeltaX = point.pageX - this.lastPointX;\n\t\tthis.lastPointX = point.pageX;\n\n\t\tdeltaY = point.pageY - this.lastPointY;\n\t\tthis.lastPointY = point.pageY;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\tthis._pos(newX, newY);\n\n// INSERT POINT: indicator._move\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.initiated = false;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tutils.removeEvent(window, 'touchmove', this);\n\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\tif ( this.scroller.options.snap ) {\n\t\t\tvar snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);\n\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.x - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.y - snap.y), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tif ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {\n\t\t\t\tthis.scroller.directionX = 0;\n\t\t\t\tthis.scroller.directionY = 0;\n\t\t\t\tthis.scroller.currentPage = snap;\n\t\t\t\tthis.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\ttransitionTime: function (time) {\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.indicatorStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.indicatorStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.indicatorStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.indicatorStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\ttransitionTimingFunction: function (easing) {\n\t\tthis.indicatorStyle[utils.style.transitionTimingFunction] = easing;\n\t},\n\n\trefresh: function () {\n\t\tthis.transitionTime();\n\n\t\tif ( this.options.listenX && !this.options.listenY ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';\n\t\t} else if ( this.options.listenY && !this.options.listenX ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t} else {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t}\n\n\t\tif ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {\n\t\t\tutils.addClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.removeClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '8px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '8px';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tutils.removeClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.addClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '2px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '2px';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tutils.getRect(this.wrapper);\t// force refresh\n\n\t\tif ( this.options.listenX ) {\n\t\t\tthis.wrapperWidth = this.wrapper.clientWidth;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);\n\t\t\t\tthis.indicatorStyle.width = this.indicatorWidth + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorWidth = this.indicator.clientWidth;\n\t\t\t}\n\n\t\t\tthis.maxPosX = this.wrapperWidth - this.indicatorWidth;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryX = -this.indicatorWidth + 8;\n\t\t\t\tthis.maxBoundaryX = this.wrapperWidth - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryX = 0;\n\t\t\t\tthis.maxBoundaryX = this.maxPosX;\n\t\t\t}\n\n\t\t\tthis.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));\n\t\t}\n\n\t\tif ( this.options.listenY ) {\n\t\t\tthis.wrapperHeight = this.wrapper.clientHeight;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);\n\t\t\t\tthis.indicatorStyle.height = this.indicatorHeight + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorHeight = this.indicator.clientHeight;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryY = -this.indicatorHeight + 8;\n\t\t\t\tthis.maxBoundaryY = this.wrapperHeight - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryY = 0;\n\t\t\t\tthis.maxBoundaryY = this.maxPosY;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\t\t\tthis.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY));\n\t\t}\n\n\t\tthis.updatePosition();\n\t},\n\n\tupdatePosition: function () {\n\t\tvar x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,\n\t\t\ty = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;\n\n\t\tif ( !this.options.ignoreBoundaries ) {\n\t\t\tif ( x < this.minBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth + x, 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t}\n\t\t\t\tx = this.minBoundaryX;\n\t\t\t} else if ( x > this.maxBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t\tx = this.maxPosX + this.indicatorWidth - this.width;\n\t\t\t\t} else {\n\t\t\t\t\tx = this.maxBoundaryX;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {\n\t\t\t\tthis.width = this.indicatorWidth;\n\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t}\n\n\t\t\tif ( y < this.minBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight + y * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t}\n\t\t\t\ty = this.minBoundaryY;\n\t\t\t} else if ( y > this.maxBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t\ty = this.maxPosY + this.indicatorHeight - this.height;\n\t\t\t\t} else {\n\t\t\t\t\ty = this.maxBoundaryY;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {\n\t\t\t\tthis.height = this.indicatorHeight;\n\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t}\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tif ( this.scroller.options.useTransform ) {\n\t\t\tthis.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;\n\t\t} else {\n\t\t\tthis.indicatorStyle.left = x + 'px';\n\t\t\tthis.indicatorStyle.top = y + 'px';\n\t\t}\n\t},\n\n\t_pos: function (x, y) {\n\t\tif ( x < 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x > this.maxPosX ) {\n\t\t\tx = this.maxPosX;\n\t\t}\n\n\t\tif ( y < 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y > this.maxPosY ) {\n\t\t\ty = this.maxPosY;\n\t\t}\n\n\t\tx = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;\n\t\ty = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;\n\n\t\tthis.scroller.scrollTo(x, y);\n\t},\n\n\tfade: function (val, hold) {\n\t\tif ( hold && !this.visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(this.fadeTimeout);\n\t\tthis.fadeTimeout = null;\n\n\t\tvar time = val ? 250 : 500,\n\t\t\tdelay = val ? 0 : 300;\n\n\t\tval = val ? '1' : '0';\n\n\t\tthis.wrapperStyle[utils.style.transitionDuration] = time + 'ms';\n\n\t\tthis.fadeTimeout = setTimeout((function (val) {\n\t\t\tthis.wrapperStyle.opacity = val;\n\t\t\tthis.visible = +val;\n\t\t}).bind(this, val), delay);\n\t}\n};\n\nIScroll.utils = utils;\n\nif ( typeof module != 'undefined' && module.exports ) {\n\tmodule.exports = IScroll;\n} else if ( typeof define == 'function' && define.amd ) {\n        define( function () { return IScroll; } );\n} else {\n\twindow.IScroll = IScroll;\n}\n\n})(window, document, Math);\n"
  },
  {
    "path": "build/iscroll.js",
    "content": "/*! iScroll v5.2.0-snapshot ~ (c) 2008-2017 Matteo Spinelli ~ http://cubiq.org/license */\n(function (window, document, Math) {\nvar rAF = window.requestAnimationFrame\t||\n\twindow.webkitRequestAnimationFrame\t||\n\twindow.mozRequestAnimationFrame\t\t||\n\twindow.oRequestAnimationFrame\t\t||\n\twindow.msRequestAnimationFrame\t\t||\n\tfunction (callback) { window.setTimeout(callback, 1000 / 60); };\n\nvar utils = (function () {\n\tvar me = {};\n\n\tvar _elementStyle = document.createElement('div').style;\n\tvar _vendor = (function () {\n\t\tvar vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],\n\t\t\ttransform,\n\t\t\ti = 0,\n\t\t\tl = vendors.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\ttransform = vendors[i] + 'ransform';\n\t\t\tif ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);\n\t\t}\n\n\t\treturn false;\n\t})();\n\n\tfunction _prefixStyle (style) {\n\t\tif ( _vendor === false ) return false;\n\t\tif ( _vendor === '' ) return style;\n\t\treturn _vendor + style.charAt(0).toUpperCase() + style.substr(1);\n\t}\n\n\tme.getTime = Date.now || function getTime () { return new Date().getTime(); };\n\n\tme.extend = function (target, obj) {\n\t\tfor ( var i in obj ) {\n\t\t\ttarget[i] = obj[i];\n\t\t}\n\t};\n\n\tme.addEvent = function (el, type, fn, capture) {\n\t\tel.addEventListener(type, fn, !!capture);\n\t};\n\n\tme.removeEvent = function (el, type, fn, capture) {\n\t\tel.removeEventListener(type, fn, !!capture);\n\t};\n\n\tme.prefixPointerEvent = function (pointerEvent) {\n\t\treturn window.MSPointerEvent ?\n\t\t\t'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):\n\t\t\tpointerEvent;\n\t};\n\n\tme.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {\n\t\tvar distance = current - start,\n\t\t\tspeed = Math.abs(distance) / time,\n\t\t\tdestination,\n\t\t\tduration;\n\n\t\tdeceleration = deceleration === undefined ? 0.0006 : deceleration;\n\n\t\tdestination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\n\t\tduration = speed / deceleration;\n\n\t\tif ( destination < lowerMargin ) {\n\t\t\tdestination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\n\t\t\tdistance = Math.abs(destination - current);\n\t\t\tduration = distance / speed;\n\t\t} else if ( destination > 0 ) {\n\t\t\tdestination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\n\t\t\tdistance = Math.abs(current) + destination;\n\t\t\tduration = distance / speed;\n\t\t}\n\n\t\treturn {\n\t\t\tdestination: Math.round(destination),\n\t\t\tduration: duration\n\t\t};\n\t};\n\n\tvar _transform = _prefixStyle('transform');\n\n\tme.extend(me, {\n\t\thasTransform: _transform !== false,\n\t\thasPerspective: _prefixStyle('perspective') in _elementStyle,\n\t\thasTouch: 'ontouchstart' in window,\n\t\thasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed\n\t\thasTransition: _prefixStyle('transition') in _elementStyle\n\t});\n\n\t/*\n\tThis should find all Android browsers lower than build 535.19 (both stock browser and webview)\n\t- galaxy S2 is ok\n    - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`\n    - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S3 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S4 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S5 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n   - galaxy S6 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n  */\n\tme.isBadAndroid = (function() {\n\t\tvar appVersion = window.navigator.appVersion;\n\t\t// Android browser is not a chrome browser.\n\t\tif (/Android/.test(appVersion) && !(/Chrome\\/\\d/.test(appVersion))) {\n\t\t\tvar safariVersion = appVersion.match(/Safari\\/(\\d+.\\d)/);\n\t\t\tif(safariVersion && typeof safariVersion === \"object\" && safariVersion.length >= 2) {\n\t\t\t\treturn parseFloat(safariVersion[1]) < 535.19;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\tme.extend(me.style = {}, {\n\t\ttransform: _transform,\n\t\ttransitionTimingFunction: _prefixStyle('transitionTimingFunction'),\n\t\ttransitionDuration: _prefixStyle('transitionDuration'),\n\t\ttransitionDelay: _prefixStyle('transitionDelay'),\n\t\ttransformOrigin: _prefixStyle('transformOrigin'),\n\t\ttouchAction: _prefixStyle('touchAction')\n\t});\n\n\tme.hasClass = function (e, c) {\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\");\n\t\treturn re.test(e.className);\n\t};\n\n\tme.addClass = function (e, c) {\n\t\tif ( me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar newclass = e.className.split(' ');\n\t\tnewclass.push(c);\n\t\te.className = newclass.join(' ');\n\t};\n\n\tme.removeClass = function (e, c) {\n\t\tif ( !me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\", 'g');\n\t\te.className = e.className.replace(re, ' ');\n\t};\n\n\tme.offset = function (el) {\n\t\tvar left = -el.offsetLeft,\n\t\t\ttop = -el.offsetTop;\n\n\t\t// jshint -W084\n\t\twhile (el = el.offsetParent) {\n\t\t\tleft -= el.offsetLeft;\n\t\t\ttop -= el.offsetTop;\n\t\t}\n\t\t// jshint +W084\n\n\t\treturn {\n\t\t\tleft: left,\n\t\t\ttop: top\n\t\t};\n\t};\n\n\tme.preventDefaultException = function (el, exceptions) {\n\t\tfor ( var i in exceptions ) {\n\t\t\tif ( exceptions[i].test(el[i]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tme.extend(me.eventType = {}, {\n\t\ttouchstart: 1,\n\t\ttouchmove: 1,\n\t\ttouchend: 1,\n\n\t\tmousedown: 2,\n\t\tmousemove: 2,\n\t\tmouseup: 2,\n\n\t\tpointerdown: 3,\n\t\tpointermove: 3,\n\t\tpointerup: 3,\n\n\t\tMSPointerDown: 3,\n\t\tMSPointerMove: 3,\n\t\tMSPointerUp: 3\n\t});\n\n\tme.extend(me.ease = {}, {\n\t\tquadratic: {\n\t\t\tstyle: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n\t\t\tfn: function (k) {\n\t\t\t\treturn k * ( 2 - k );\n\t\t\t}\n\t\t},\n\t\tcircular: {\n\t\t\tstyle: 'cubic-bezier(0.1, 0.57, 0.1, 1)',\t// Not properly \"circular\" but this looks better, it should be (0.075, 0.82, 0.165, 1)\n\t\t\tfn: function (k) {\n\t\t\t\treturn Math.sqrt( 1 - ( --k * k ) );\n\t\t\t}\n\t\t},\n\t\tback: {\n\t\t\tstyle: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n\t\t\tfn: function (k) {\n\t\t\t\tvar b = 4;\n\t\t\t\treturn ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;\n\t\t\t}\n\t\t},\n\t\tbounce: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tif ( ( k /= 1 ) < ( 1 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * k * k;\n\t\t\t\t} else if ( k < ( 2 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n\t\t\t\t} else if ( k < ( 2.5 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n\t\t\t\t} else {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\telastic: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tvar f = 0.22,\n\t\t\t\t\te = 0.4;\n\n\t\t\t\tif ( k === 0 ) { return 0; }\n\t\t\t\tif ( k == 1 ) { return 1; }\n\n\t\t\t\treturn ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );\n\t\t\t}\n\t\t}\n\t});\n\n\tme.tap = function (e, eventName) {\n\t\tvar ev = document.createEvent('Event');\n\t\tev.initEvent(eventName, true, true);\n\t\tev.pageX = e.pageX;\n\t\tev.pageY = e.pageY;\n\t\te.target.dispatchEvent(ev);\n\t};\n\n\tme.click = function (e) {\n\t\tvar target = e.target,\n\t\t\tev;\n\n\t\tif ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n\t\t\t// initMouseEvent is deprecated.\n\t\t\tev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');\n\t\t\tev.initEvent('click', true, true);\n\t\t\tev.view = e.view || window;\n\t\t\tev.detail = 1;\n\t\t\tev.screenX = target.screenX || 0;\n\t\t\tev.screenY = target.screenY || 0;\n\t\t\tev.clientX = target.clientX || 0;\n\t\t\tev.clientY = target.clientY || 0;\n\t\t\tev.ctrlKey = !!e.ctrlKey;\n\t\t\tev.altKey = !!e.altKey;\n\t\t\tev.shiftKey = !!e.shiftKey;\n\t\t\tev.metaKey = !!e.metaKey;\n\t\t\tev.button = 0;\n\t\t\tev.relatedTarget = null;\n\t\t\tev._constructed = true;\n\t\t\ttarget.dispatchEvent(ev);\n\t\t}\n\t};\n\n\tme.getTouchAction = function(eventPassthrough, addPinch) {\n\t\tvar touchAction = 'none';\n\t\tif ( eventPassthrough === 'vertical' ) {\n\t\t\ttouchAction = 'pan-y';\n\t\t} else if (eventPassthrough === 'horizontal' ) {\n\t\t\ttouchAction = 'pan-x';\n\t\t}\n\t\tif (addPinch && touchAction != 'none') {\n\t\t\t// add pinch-zoom support if the browser supports it, but if not (eg. Chrome <55) do nothing\n\t\t\ttouchAction += ' pinch-zoom';\n\t\t}\n\t\treturn touchAction;\n\t};\n\n\tme.getRect = function(el) {\n\t\tif (el instanceof SVGElement) {\n\t\t\tvar rect = el.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop : rect.top,\n\t\t\t\tleft : rect.left,\n\t\t\t\twidth : rect.width,\n\t\t\t\theight : rect.height\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttop : el.offsetTop,\n\t\t\t\tleft : el.offsetLeft,\n\t\t\t\twidth : el.offsetWidth,\n\t\t\t\theight : el.offsetHeight\n\t\t\t};\n\t\t}\n\t};\n\n\treturn me;\n})();\nfunction IScroll (el, options) {\n\tthis.wrapper = typeof el == 'string' ? document.querySelector(el) : el;\n\tthis.scroller = this.wrapper.children[0];\n\tthis.scrollerStyle = this.scroller.style;\t\t// cache style for better performance\n\n\tthis.options = {\n\n\t\tresizeScrollbars: true,\n\n\t\tmouseWheelSpeed: 20,\n\n\t\tsnapThreshold: 0.334,\n\n// INSERT POINT: OPTIONS\n\t\tdisablePointer : !utils.hasPointer,\n\t\tdisableTouch : utils.hasPointer || !utils.hasTouch,\n\t\tdisableMouse : utils.hasPointer || utils.hasTouch,\n\t\tstartX: 0,\n\t\tstartY: 0,\n\t\tscrollY: true,\n\t\tdirectionLockThreshold: 5,\n\t\tmomentum: true,\n\n\t\tbounce: true,\n\t\tbounceTime: 600,\n\t\tbounceEasing: '',\n\n\t\tpreventDefault: true,\n\t\tpreventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },\n\n\t\tHWCompositing: true,\n\t\tuseTransition: true,\n\t\tuseTransform: true,\n\t\tbindToWrapper: typeof window.onmousedown === \"undefined\"\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\t// Normalize options\n\tthis.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';\n\n\tthis.options.useTransition = utils.hasTransition && this.options.useTransition;\n\tthis.options.useTransform = utils.hasTransform && this.options.useTransform;\n\n\tthis.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;\n\tthis.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;\n\n\t// If you want eventPassthrough I have to lock one of the axes\n\tthis.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;\n\tthis.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;\n\n\t// With eventPassthrough we also need lockDirection mechanism\n\tthis.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;\n\tthis.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;\n\n\tthis.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;\n\n\tthis.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;\n\n\tif ( this.options.tap === true ) {\n\t\tthis.options.tap = 'tap';\n\t}\n\n\t// https://github.com/cubiq/iscroll/issues/1029\n\tif (!this.options.useTransition && !this.options.useTransform) {\n\t\tif(!(/relative|absolute/i).test(this.scrollerStyle.position)) {\n\t\t\tthis.scrollerStyle.position = \"relative\";\n\t\t}\n\t}\n\n\tif ( this.options.shrinkScrollbars == 'scale' ) {\n\t\tthis.options.useTransition = false;\n\t}\n\n\tthis.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;\n\n// INSERT POINT: NORMALIZATION\n\n\t// Some defaults\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.directionX = 0;\n\tthis.directionY = 0;\n\tthis._events = {};\n\n// INSERT POINT: DEFAULTS\n\n\tthis._init();\n\tthis.refresh();\n\n\tthis.scrollTo(this.options.startX, this.options.startY);\n\tthis.enable();\n}\n\nIScroll.prototype = {\n\tversion: '5.2.0-snapshot',\n\n\t_init: function () {\n\t\tthis._initEvents();\n\n\t\tif ( this.options.scrollbars || this.options.indicators ) {\n\t\t\tthis._initIndicators();\n\t\t}\n\n\t\tif ( this.options.mouseWheel ) {\n\t\t\tthis._initWheel();\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tthis._initSnap();\n\t\t}\n\n\t\tif ( this.options.keyBindings ) {\n\t\t\tthis._initKeys();\n\t\t}\n\n// INSERT POINT: _init\n\n\t},\n\n\tdestroy: function () {\n\t\tthis._initEvents(true);\n\t\tclearTimeout(this.resizeTimeout);\n \t\tthis.resizeTimeout = null;\n\t\tthis._execEvent('destroy');\n\t},\n\n\t_transitionEnd: function (e) {\n\t\tif ( e.target != this.scroller || !this.isInTransition ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._transitionTime();\n\t\tif ( !this.resetPosition(this.options.bounceTime) ) {\n\t\t\tthis.isInTransition = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\t// React to left mouse button only\n\t\tif ( utils.eventType[e.type] != 1 ) {\n\t\t  // for button property\n\t\t  // http://unixpapa.com/js/mouse.html\n\t\t  var button;\n\t    if (!e.which) {\n\t      /* IE case */\n\t      button = (e.button < 2) ? 0 :\n\t               ((e.button == 4) ? 1 : 2);\n\t    } else {\n\t      /* All others */\n\t      button = e.button;\n\t    }\n\t\t\tif ( button !== 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tpos;\n\n\t\tthis.initiated\t= utils.eventType[e.type];\n\t\tthis.moved\t\t= false;\n\t\tthis.distX\t\t= 0;\n\t\tthis.distY\t\t= 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\tthis.directionLocked = 0;\n\n\t\tthis.startTime = utils.getTime();\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tthis._transitionTime();\n\t\t\tthis.isInTransition = false;\n\t\t\tpos = this.getComputedPosition();\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis._execEvent('scrollEnd');\n\t\t} else if ( !this.options.useTransition && this.isAnimating ) {\n\t\t\tthis.isAnimating = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\n\t\tthis.startX    = this.x;\n\t\tthis.startY    = this.y;\n\t\tthis.absStartX = this.x;\n\t\tthis.absStartY = this.y;\n\t\tthis.pointX    = point.pageX;\n\t\tthis.pointY    = point.pageY;\n\n\t\tthis._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\t// increases performance on Android? TODO: check!\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point\t\t= e.touches ? e.touches[0] : e,\n\t\t\tdeltaX\t\t= point.pageX - this.pointX,\n\t\t\tdeltaY\t\t= point.pageY - this.pointY,\n\t\t\ttimestamp\t= utils.getTime(),\n\t\t\tnewX, newY,\n\t\t\tabsDistX, absDistY;\n\n\t\tthis.pointX\t\t= point.pageX;\n\t\tthis.pointY\t\t= point.pageY;\n\n\t\tthis.distX\t\t+= deltaX;\n\t\tthis.distY\t\t+= deltaY;\n\t\tabsDistX\t\t= Math.abs(this.distX);\n\t\tabsDistY\t\t= Math.abs(this.distY);\n\n\t\t// We need to move at least 10 pixels for the scrolling to initiate\n\t\tif ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If you are scrolling in one direction lock the other\n\t\tif ( !this.directionLocked && !this.options.freeScroll ) {\n\t\t\tif ( absDistX > absDistY + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'h';\t\t// lock horizontally\n\t\t\t} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'v';\t\t// lock vertically\n\t\t\t} else {\n\t\t\t\tthis.directionLocked = 'n';\t\t// no lock\n\t\t\t}\n\t\t}\n\n\t\tif ( this.directionLocked == 'h' ) {\n\t\t\tif ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaY = 0;\n\t\t} else if ( this.directionLocked == 'v' ) {\n\t\t\tif ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaX = 0;\n\t\t}\n\n\t\tdeltaX = this.hasHorizontalScroll ? deltaX : 0;\n\t\tdeltaY = this.hasVerticalScroll ? deltaY : 0;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\t// Slow down if outside of the boundaries\n\t\tif ( newX > 0 || newX < this.maxScrollX ) {\n\t\t\tnewX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;\n\t\t}\n\t\tif ( newY > 0 || newY < this.maxScrollY ) {\n\t\t\tnewY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;\n\t\t}\n\n\t\tthis.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;\n\t\tthis.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;\n\n\t\tif ( !this.moved ) {\n\t\t\tthis._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tthis._translate(newX, newY);\n\n/* REPLACE START: _move */\n\n\t\tif ( timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.startX = this.x;\n\t\t\tthis.startY = this.y;\n\t\t}\n\n/* REPLACE END: _move */\n\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.changedTouches ? e.changedTouches[0] : e,\n\t\t\tmomentumX,\n\t\t\tmomentumY,\n\t\t\tduration = utils.getTime() - this.startTime,\n\t\t\tnewX = Math.round(this.x),\n\t\t\tnewY = Math.round(this.y),\n\t\t\tdistanceX = Math.abs(newX - this.startX),\n\t\t\tdistanceY = Math.abs(newY - this.startY),\n\t\t\ttime = 0,\n\t\t\teasing = '';\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\t\tthis.endTime = utils.getTime();\n\n\t\t// reset if we are outside of the boundaries\n\t\tif ( this.resetPosition(this.options.bounceTime) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY);\t// ensures that the last position is rounded\n\n\t\t// we scrolled less than 10 pixels\n\t\tif ( !this.moved ) {\n\t\t\tif ( this.options.tap ) {\n\t\t\t\tutils.tap(e, this.options.tap);\n\t\t\t}\n\n\t\t\tif ( this.options.click ) {\n\t\t\t\tutils.click(e);\n\t\t\t}\n\n\t\t\tthis._execEvent('scrollCancel');\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {\n\t\t\tthis._execEvent('flick');\n\t\t\treturn;\n\t\t}\n\n\t\t// start momentum animation if needed\n\t\tif ( this.options.momentum && duration < 300 ) {\n\t\t\tmomentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };\n\t\t\tmomentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };\n\t\t\tnewX = momentumX.destination;\n\t\t\tnewY = momentumY.destination;\n\t\t\ttime = Math.max(momentumX.duration, momentumY.duration);\n\t\t\tthis.isInTransition = 1;\n\t\t}\n\n\n\t\tif ( this.options.snap ) {\n\t\t\tvar snap = this._nearestSnap(newX, newY);\n\t\t\tthis.currentPage = snap;\n\t\t\ttime = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(newX - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(newY - snap.y), 1000)\n\t\t\t\t\t), 300);\n\t\t\tnewX = snap.x;\n\t\t\tnewY = snap.y;\n\n\t\t\tthis.directionX = 0;\n\t\t\tthis.directionY = 0;\n\t\t\teasing = this.options.bounceEasing;\n\t\t}\n\n// INSERT POINT: _end\n\n\t\tif ( newX != this.x || newY != this.y ) {\n\t\t\t// change easing function when scroller goes out of the boundaries\n\t\t\tif ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {\n\t\t\t\teasing = utils.ease.quadratic;\n\t\t\t}\n\n\t\t\tthis.scrollTo(newX, newY, time, easing);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._execEvent('scrollEnd');\n\t},\n\n\t_resize: function () {\n\t\tvar that = this;\n\n\t\tclearTimeout(this.resizeTimeout);\n\n\t\tthis.resizeTimeout = setTimeout(function () {\n\t\t\tthat.refresh();\n\t\t}, this.options.resizePolling);\n\t},\n\n\tresetPosition: function (time) {\n\t\tvar x = this.x,\n\t\t\ty = this.y;\n\n\t\ttime = time || 0;\n\n\t\tif ( !this.hasHorizontalScroll || this.x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( this.x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll || this.y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( this.y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tif ( x == this.x && y == this.y ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time, this.options.bounceEasing);\n\n\t\treturn true;\n\t},\n\n\tdisable: function () {\n\t\tthis.enabled = false;\n\t},\n\n\tenable: function () {\n\t\tthis.enabled = true;\n\t},\n\n\trefresh: function () {\n\t\tutils.getRect(this.wrapper);\t\t// Force reflow\n\n\t\tthis.wrapperWidth\t= this.wrapper.clientWidth;\n\t\tthis.wrapperHeight\t= this.wrapper.clientHeight;\n\n\t\tvar rect = utils.getRect(this.scroller);\n/* REPLACE START: refresh */\n\n\t\tthis.scrollerWidth\t= rect.width;\n\t\tthis.scrollerHeight\t= rect.height;\n\n\t\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\t\tthis.maxScrollY\t\t= this.wrapperHeight - this.scrollerHeight;\n\n/* REPLACE END: refresh */\n\n\t\tthis.hasHorizontalScroll\t= this.options.scrollX && this.maxScrollX < 0;\n\t\tthis.hasVerticalScroll\t\t= this.options.scrollY && this.maxScrollY < 0;\n\t\t\n\t\tif ( !this.hasHorizontalScroll ) {\n\t\t\tthis.maxScrollX = 0;\n\t\t\tthis.scrollerWidth = this.wrapperWidth;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\tthis.maxScrollY = 0;\n\t\t\tthis.scrollerHeight = this.wrapperHeight;\n\t\t}\n\n\t\tthis.endTime = 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\t\n\t\tif(utils.hasPointer && !this.options.disablePointer) {\n\t\t\t// The wrapper should have `touchAction` property for using pointerEvent.\n\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, true);\n\n\t\t\t// case. not support 'pinch-zoom'\n\t\t\t// https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583\n\t\t\tif (!this.wrapper.style[utils.style.touchAction]) {\n\t\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, false);\n\t\t\t}\n\t\t}\n\t\tthis.wrapperOffset = utils.offset(this.wrapper);\n\n\t\tthis._execEvent('refresh');\n\n\t\tthis.resetPosition();\n\n// INSERT POINT: _refresh\n\n\t},\t\n\n\ton: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\tthis._events[type] = [];\n\t\t}\n\n\t\tthis._events[type].push(fn);\n\t},\n\n\toff: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar index = this._events[type].indexOf(fn);\n\n\t\tif ( index > -1 ) {\n\t\t\tthis._events[type].splice(index, 1);\n\t\t}\n\t},\n\n\t_execEvent: function (type) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this._events[type].length;\n\n\t\tif ( !l ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tthis._events[type][i].apply(this, [].slice.call(arguments, 1));\n\t\t}\n\t},\n\n\tscrollBy: function (x, y, time, easing) {\n\t\tx = this.x + x;\n\t\ty = this.y + y;\n\t\ttime = time || 0;\n\n\t\tthis.scrollTo(x, y, time, easing);\n\t},\n\n\tscrollTo: function (x, y, time, easing) {\n\t\teasing = easing || utils.ease.circular;\n\n\t\tthis.isInTransition = this.options.useTransition && time > 0;\n\t\tvar transitionType = this.options.useTransition && easing.style;\n\t\tif ( !time || transitionType ) {\n\t\t\t\tif(transitionType) {\n\t\t\t\t\tthis._transitionTimingFunction(easing.style);\n\t\t\t\t\tthis._transitionTime(time);\n\t\t\t\t}\n\t\t\tthis._translate(x, y);\n\t\t} else {\n\t\t\tthis._animate(x, y, time, easing.fn);\n\t\t}\n\t},\n\n\tscrollToElement: function (el, time, offsetX, offsetY, easing) {\n\t\tel = el.nodeType ? el : this.scroller.querySelector(el);\n\n\t\tif ( !el ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar pos = utils.offset(el);\n\n\t\tpos.left -= this.wrapperOffset.left;\n\t\tpos.top  -= this.wrapperOffset.top;\n\n\t\t// if offsetX/Y are true we center the element to the screen\n\t\tvar elRect = utils.getRect(el);\n\t\tvar wrapperRect = utils.getRect(this.wrapper);\n\t\tif ( offsetX === true ) {\n\t\t\toffsetX = Math.round(elRect.width / 2 - wrapperRect.width / 2);\n\t\t}\n\t\tif ( offsetY === true ) {\n\t\t\toffsetY = Math.round(elRect.height / 2 - wrapperRect.height / 2);\n\t\t}\n\n\t\tpos.left -= offsetX || 0;\n\t\tpos.top  -= offsetY || 0;\n\n\t\tpos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;\n\t\tpos.top  = pos.top  > 0 ? 0 : pos.top  < this.maxScrollY ? this.maxScrollY : pos.top;\n\n\t\ttime = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;\n\n\t\tthis.scrollTo(pos.left, pos.top, time, easing);\n\t},\n\n\t_transitionTime: function (time) {\n\t\tif (!this.options.useTransition) {\n\t\t\treturn;\n\t\t}\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollerStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.scrollerStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.scrollerStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.scrollerStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTime(time);\n\t\t\t}\n\t\t}\n\n\n// INSERT POINT: _transitionTime\n\n\t},\n\n\t_transitionTimingFunction: function (easing) {\n\t\tthis.scrollerStyle[utils.style.transitionTimingFunction] = easing;\n\n\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTimingFunction(easing);\n\t\t\t}\n\t\t}\n\n\n// INSERT POINT: _transitionTimingFunction\n\n\t},\n\n\t_translate: function (x, y) {\n\t\tif ( this.options.useTransform ) {\n\n/* REPLACE START: _translate */\n\n\t\t\tthis.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;\n\n/* REPLACE END: _translate */\n\n\t\t} else {\n\t\t\tx = Math.round(x);\n\t\t\ty = Math.round(y);\n\t\t\tthis.scrollerStyle.left = x + 'px';\n\t\t\tthis.scrollerStyle.top = y + 'px';\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\n\tif ( this.indicators ) {\n\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\tthis.indicators[i].updatePosition();\n\t\t}\n\t}\n\n\n// INSERT POINT: _translate\n\n\t},\n\n\t_initEvents: function (remove) {\n\t\tvar eventType = remove ? utils.removeEvent : utils.addEvent,\n\t\t\ttarget = this.options.bindToWrapper ? this.wrapper : window;\n\n\t\teventType(window, 'orientationchange', this);\n\t\teventType(window, 'resize', this);\n\n\t\tif ( this.options.click ) {\n\t\t\teventType(this.wrapper, 'click', this, true);\n\t\t}\n\n\t\tif ( !this.options.disableMouse ) {\n\t\t\teventType(this.wrapper, 'mousedown', this);\n\t\t\teventType(target, 'mousemove', this);\n\t\t\teventType(target, 'mousecancel', this);\n\t\t\teventType(target, 'mouseup', this);\n\t\t}\n\n\t\tif ( utils.hasPointer && !this.options.disablePointer ) {\n\t\t\teventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointermove'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointercancel'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\n\t\tif ( utils.hasTouch && !this.options.disableTouch ) {\n\t\t\teventType(this.wrapper, 'touchstart', this);\n\t\t\teventType(target, 'touchmove', this);\n\t\t\teventType(target, 'touchcancel', this);\n\t\t\teventType(target, 'touchend', this);\n\t\t}\n\n\t\teventType(this.scroller, 'transitionend', this);\n\t\teventType(this.scroller, 'webkitTransitionEnd', this);\n\t\teventType(this.scroller, 'oTransitionEnd', this);\n\t\teventType(this.scroller, 'MSTransitionEnd', this);\n\t},\n\n\tgetComputedPosition: function () {\n\t\tvar matrix = window.getComputedStyle(this.scroller, null),\n\t\t\tx, y;\n\n\t\tif ( this.options.useTransform ) {\n\t\t\tmatrix = matrix[utils.style.transform].split(')')[0].split(', ');\n\t\t\tx = +(matrix[12] || matrix[4]);\n\t\t\ty = +(matrix[13] || matrix[5]);\n\t\t} else {\n\t\t\tx = +matrix.left.replace(/[^-\\d.]/g, '');\n\t\t\ty = +matrix.top.replace(/[^-\\d.]/g, '');\n\t\t}\n\n\t\treturn { x: x, y: y };\n\t},\n\t_initIndicators: function () {\n\t\tvar interactive = this.options.interactiveScrollbars,\n\t\t\tcustomStyle = typeof this.options.scrollbars != 'string',\n\t\t\tindicators = [],\n\t\t\tindicator;\n\n\t\tvar that = this;\n\n\t\tthis.indicators = [];\n\n\t\tif ( this.options.scrollbars ) {\n\t\t\t// Vertical scrollbar\n\t\t\tif ( this.options.scrollY ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('v', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenX: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\n\t\t\t// Horizontal scrollbar\n\t\t\tif ( this.options.scrollX ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('h', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenY: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.indicators ) {\n\t\t\t// TODO: check concat compatibility\n\t\t\tindicators = indicators.concat(this.options.indicators);\n\t\t}\n\n\t\tfor ( var i = indicators.length; i--; ) {\n\t\t\tthis.indicators.push( new Indicator(this, indicators[i]) );\n\t\t}\n\n\t\t// TODO: check if we can use array.map (wide compatibility and performance issues)\n\t\tfunction _indicatorsMap (fn) {\n\t\t\tif (that.indicators) {\n\t\t\t\tfor ( var i = that.indicators.length; i--; ) {\n\t\t\t\t\tfn.call(that.indicators[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tthis.on('scrollEnd', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollCancel', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('beforeScrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1, true);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\n\t\tthis.on('refresh', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.refresh();\n\t\t\t});\n\t\t});\n\n\t\tthis.on('destroy', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.destroy();\n\t\t\t});\n\n\t\t\tdelete this.indicators;\n\t\t});\n\t},\n\n\t_initWheel: function () {\n\t\tutils.addEvent(this.wrapper, 'wheel', this);\n\t\tutils.addEvent(this.wrapper, 'mousewheel', this);\n\t\tutils.addEvent(this.wrapper, 'DOMMouseScroll', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tclearTimeout(this.wheelTimeout);\n\t\t\tthis.wheelTimeout = null;\n\t\t\tutils.removeEvent(this.wrapper, 'wheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'mousewheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'DOMMouseScroll', this);\n\t\t});\n\t},\n\n\t_wheel: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tvar wheelDeltaX, wheelDeltaY,\n\t\t\tnewX, newY,\n\t\t\tthat = this;\n\n\t\tif ( this.wheelTimeout === undefined ) {\n\t\t\tthat._execEvent('scrollStart');\n\t\t}\n\n\t\t// Execute the scrollEnd event after 400ms the wheel stopped scrolling\n\t\tclearTimeout(this.wheelTimeout);\n\t\tthis.wheelTimeout = setTimeout(function () {\n\t\t\tif(!that.options.snap) {\n\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t}\n\t\t\tthat.wheelTimeout = undefined;\n\t\t}, 400);\n\n\t\tif ( 'deltaX' in e ) {\n\t\t\tif (e.deltaMode === 1) {\n\t\t\t\twheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;\n\t\t\t\twheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;\n\t\t\t} else {\n\t\t\t\twheelDeltaX = -e.deltaX;\n\t\t\t\twheelDeltaY = -e.deltaY;\n\t\t\t}\n\t\t} else if ( 'wheelDeltaX' in e ) {\n\t\t\twheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;\n\t\t\twheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'wheelDelta' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'detail' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\twheelDeltaX *= this.options.invertWheelDirection;\n\t\twheelDeltaY *= this.options.invertWheelDirection;\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\twheelDeltaX = wheelDeltaY;\n\t\t\twheelDeltaY = 0;\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tnewX = this.currentPage.pageX;\n\t\t\tnewY = this.currentPage.pageY;\n\n\t\t\tif ( wheelDeltaX > 0 ) {\n\t\t\t\tnewX--;\n\t\t\t} else if ( wheelDeltaX < 0 ) {\n\t\t\t\tnewX++;\n\t\t\t}\n\n\t\t\tif ( wheelDeltaY > 0 ) {\n\t\t\t\tnewY--;\n\t\t\t} else if ( wheelDeltaY < 0 ) {\n\t\t\t\tnewY++;\n\t\t\t}\n\n\t\t\tthis.goToPage(newX, newY);\n\n\t\t\treturn;\n\t\t}\n\n\t\tnewX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);\n\t\tnewY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);\n\n\t\tthis.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;\n\t\tthis.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n// INSERT POINT: _wheel\n\t},\n\n\t_initSnap: function () {\n\t\tthis.currentPage = {};\n\n\t\tif ( typeof this.options.snap == 'string' ) {\n\t\t\tthis.options.snap = this.scroller.querySelectorAll(this.options.snap);\n\t\t}\n\n\t\tthis.on('refresh', function () {\n\t\t\tvar i = 0, l,\n\t\t\t\tm = 0, n,\n\t\t\t\tcx, cy,\n\t\t\t\tx = 0, y,\n\t\t\t\tstepX = this.options.snapStepX || this.wrapperWidth,\n\t\t\t\tstepY = this.options.snapStepY || this.wrapperHeight,\n\t\t\t\tel,\n\t\t\t\trect;\n\n\t\t\tthis.pages = [];\n\n\t\t\tif ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.options.snap === true ) {\n\t\t\t\tcx = Math.round( stepX / 2 );\n\t\t\t\tcy = Math.round( stepY / 2 );\n\n\t\t\t\twhile ( x > -this.scrollerWidth ) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile ( y > -this.scrollerHeight ) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tel = this.options.snap;\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\trect = utils.getRect(el[i]);\n\t\t\t\t\tif ( i === 0 || rect.left <= utils.getRect(el[i-1]).left ) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !this.pages[m] ) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( x > this.maxScrollX ) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);\n\n\t\t\t// Update snap threshold if needed\n\t\t\tif ( this.options.snapThreshold % 1 === 0 ) {\n\t\t\t\tthis.snapThresholdX = this.options.snapThreshold;\n\t\t\t\tthis.snapThresholdY = this.options.snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('flick', function () {\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tthis.goToPage(\n\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\ttime\n\t\t\t);\n\t\t});\n\t},\n\n\t_nearestSnap: function (x, y) {\n\t\tif ( !this.pages.length ) {\n\t\t\treturn { x: 0, y: 0, pageX: 0, pageY: 0 };\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this.pages.length,\n\t\t\tm = 0;\n\n\t\t// Check if we exceeded the snap threshold\n\t\tif ( Math.abs(x - this.absStartX) < this.snapThresholdX &&\n\t\t\tMath.abs(y - this.absStartY) < this.snapThresholdY ) {\n\t\t\treturn this.currentPage;\n\t\t}\n\n\t\tif ( x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( x >= this.pages[i][0].cx ) {\n\t\t\t\tx = this.pages[i][0].x;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tl = this.pages[i].length;\n\n\t\tfor ( ; m < l; m++ ) {\n\t\t\tif ( y >= this.pages[0][m].cy ) {\n\t\t\t\ty = this.pages[0][m].y;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( i == this.currentPage.pageX ) {\n\t\t\ti += this.directionX;\n\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t} else if ( i >= this.pages.length ) {\n\t\t\t\ti = this.pages.length - 1;\n\t\t\t}\n\n\t\t\tx = this.pages[i][0].x;\n\t\t}\n\n\t\tif ( m == this.currentPage.pageY ) {\n\t\t\tm += this.directionY;\n\n\t\t\tif ( m < 0 ) {\n\t\t\t\tm = 0;\n\t\t\t} else if ( m >= this.pages[0].length ) {\n\t\t\t\tm = this.pages[0].length - 1;\n\t\t\t}\n\n\t\t\ty = this.pages[0][m].y;\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tpageX: i,\n\t\t\tpageY: m\n\t\t};\n\t},\n\n\tgoToPage: function (x, y, time, easing) {\n\t\teasing = easing || this.options.bounceEasing;\n\n\t\tif ( x >= this.pages.length ) {\n\t\t\tx = this.pages.length - 1;\n\t\t} else if ( x < 0 ) {\n\t\t\tx = 0;\n\t\t}\n\n\t\tif ( y >= this.pages[x].length ) {\n\t\t\ty = this.pages[x].length - 1;\n\t\t} else if ( y < 0 ) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tvar posX = this.pages[x][y].x,\n\t\t\tposY = this.pages[x][y].y;\n\n\t\ttime = time === undefined ? this.options.snapSpeed || Math.max(\n\t\t\tMath.max(\n\t\t\t\tMath.min(Math.abs(posX - this.x), 1000),\n\t\t\t\tMath.min(Math.abs(posY - this.y), 1000)\n\t\t\t), 300) : time;\n\n\t\tthis.currentPage = {\n\t\t\tx: posX,\n\t\t\ty: posY,\n\t\t\tpageX: x,\n\t\t\tpageY: y\n\t\t};\n\n\t\tthis.scrollTo(posX, posY, time, easing);\n\t},\n\n\tnext: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx++;\n\n\t\tif ( x >= this.pages.length && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty++;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\tprev: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx--;\n\n\t\tif ( x < 0 && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty--;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\t_initKeys: function (e) {\n\t\t// default key bindings\n\t\tvar keys = {\n\t\t\tpageUp: 33,\n\t\t\tpageDown: 34,\n\t\t\tend: 35,\n\t\t\thome: 36,\n\t\t\tleft: 37,\n\t\t\tup: 38,\n\t\t\tright: 39,\n\t\t\tdown: 40\n\t\t};\n\t\tvar i;\n\n\t\t// if you give me characters I give you keycode\n\t\tif ( typeof this.options.keyBindings == 'object' ) {\n\t\t\tfor ( i in this.options.keyBindings ) {\n\t\t\t\tif ( typeof this.options.keyBindings[i] == 'string' ) {\n\t\t\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.options.keyBindings = {};\n\t\t}\n\n\t\tfor ( i in keys ) {\n\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];\n\t\t}\n\n\t\tutils.addEvent(window, 'keydown', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tutils.removeEvent(window, 'keydown', this);\n\t\t});\n\t},\n\n\t_key: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar snap = this.options.snap,\t// we are using this alot, better to cache it\n\t\t\tnewX = snap ? this.currentPage.pageX : this.x,\n\t\t\tnewY = snap ? this.currentPage.pageY : this.y,\n\t\t\tnow = utils.getTime(),\n\t\t\tprevTime = this.keyTime || 0,\n\t\t\tacceleration = 0.250,\n\t\t\tpos;\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tpos = this.getComputedPosition();\n\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis.isInTransition = false;\n\t\t}\n\n\t\tthis.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;\n\n\t\tswitch ( e.keyCode ) {\n\t\t\tcase this.options.keyBindings.pageUp:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX += snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY += snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.pageDown:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX -= snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY -= snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.end:\n\t\t\t\tnewX = snap ? this.pages.length-1 : this.maxScrollX;\n\t\t\t\tnewY = snap ? this.pages[0].length-1 : this.maxScrollY;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.home:\n\t\t\t\tnewX = 0;\n\t\t\t\tnewY = 0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.left:\n\t\t\t\tnewX += snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.up:\n\t\t\t\tnewY += snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.right:\n\t\t\t\tnewX -= snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.down:\n\t\t\t\tnewY -= snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ( snap ) {\n\t\t\tthis.goToPage(newX, newY);\n\t\t\treturn;\n\t\t}\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n\t\tthis.keyTime = now;\n\t},\n\n\t_animate: function (destX, destY, duration, easingFn) {\n\t\tvar that = this,\n\t\t\tstartX = this.x,\n\t\t\tstartY = this.y,\n\t\t\tstartTime = utils.getTime(),\n\t\t\tdestTime = startTime + duration;\n\n\t\tfunction step () {\n\t\t\tvar now = utils.getTime(),\n\t\t\t\tnewX, newY,\n\t\t\t\teasing;\n\n\t\t\tif ( now >= destTime ) {\n\t\t\t\tthat.isAnimating = false;\n\t\t\t\tthat._translate(destX, destY);\n\n\t\t\t\tif ( !that.resetPosition(that.options.bounceTime) ) {\n\t\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnow = ( now - startTime ) / duration;\n\t\t\teasing = easingFn(now);\n\t\t\tnewX = ( destX - startX ) * easing + startX;\n\t\t\tnewY = ( destY - startY ) * easing + startY;\n\t\t\tthat._translate(newX, newY);\n\n\t\t\tif ( that.isAnimating ) {\n\t\t\t\trAF(step);\n\t\t\t}\n\t\t}\n\n\t\tthis.isAnimating = true;\n\t\tstep();\n\t},\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t\tcase 'orientationchange':\n\t\t\tcase 'resize':\n\t\t\t\tthis._resize();\n\t\t\t\tbreak;\n\t\t\tcase 'transitionend':\n\t\t\tcase 'webkitTransitionEnd':\n\t\t\tcase 'oTransitionEnd':\n\t\t\tcase 'MSTransitionEnd':\n\t\t\t\tthis._transitionEnd(e);\n\t\t\t\tbreak;\n\t\t\tcase 'wheel':\n\t\t\tcase 'DOMMouseScroll':\n\t\t\tcase 'mousewheel':\n\t\t\t\tthis._wheel(e);\n\t\t\t\tbreak;\n\t\t\tcase 'keydown':\n\t\t\t\tthis._key(e);\n\t\t\t\tbreak;\n\t\t\tcase 'click':\n\t\t\t\tif ( this.enabled && !e._constructed ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n};\nfunction createDefaultScrollbar (direction, interactive, type) {\n\tvar scrollbar = document.createElement('div'),\n\t\tindicator = document.createElement('div');\n\n\tif ( type === true ) {\n\t\tscrollbar.style.cssText = 'position:absolute;z-index:9999';\n\t\tindicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';\n\t}\n\n\tindicator.className = 'iScrollIndicator';\n\n\tif ( direction == 'h' ) {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';\n\t\t\tindicator.style.height = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollHorizontalScrollbar';\n\t} else {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';\n\t\t\tindicator.style.width = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollVerticalScrollbar';\n\t}\n\n\tscrollbar.style.cssText += ';overflow:hidden';\n\n\tif ( !interactive ) {\n\t\tscrollbar.style.pointerEvents = 'none';\n\t}\n\n\tscrollbar.appendChild(indicator);\n\n\treturn scrollbar;\n}\n\nfunction Indicator (scroller, options) {\n\tthis.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;\n\tthis.wrapperStyle = this.wrapper.style;\n\tthis.indicator = this.wrapper.children[0];\n\tthis.indicatorStyle = this.indicator.style;\n\tthis.scroller = scroller;\n\n\tthis.options = {\n\t\tlistenX: true,\n\t\tlistenY: true,\n\t\tinteractive: false,\n\t\tresize: true,\n\t\tdefaultScrollbars: false,\n\t\tshrink: false,\n\t\tfade: false,\n\t\tspeedRatioX: 0,\n\t\tspeedRatioY: 0\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\tthis.sizeRatioX = 1;\n\tthis.sizeRatioY = 1;\n\tthis.maxPosX = 0;\n\tthis.maxPosY = 0;\n\n\tif ( this.options.interactive ) {\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.addEvent(window, 'touchend', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(this.indicator, 'mousedown', this);\n\t\t\tutils.addEvent(window, 'mouseup', this);\n\t\t}\n\t}\n\n\tif ( this.options.fade ) {\n\t\tthis.wrapperStyle[utils.style.transform] = this.scroller.translateZ;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\t\tthis.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';\n\t\t// remove 0.0001ms\n\t\tvar self = this;\n\t\tif(utils.isBadAndroid) {\n\t\t\trAF(function() {\n\t\t\t\tif(self.wrapperStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.wrapperStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tthis.wrapperStyle.opacity = '0';\n\t}\n}\n\nIndicator.prototype = {\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t}\n\t},\n\n\tdestroy: function () {\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tclearTimeout(this.fadeTimeout);\n\t\t\tthis.fadeTimeout = null;\n\t\t}\n\t\tif ( this.options.interactive ) {\n\t\t\tutils.removeEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.removeEvent(this.indicator, 'mousedown', this);\n\n\t\t\tutils.removeEvent(window, 'touchmove', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\t\tutils.removeEvent(window, 'touchend', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t\tutils.removeEvent(window, 'mouseup', this);\n\t\t}\n\n\t\tif ( this.options.defaultScrollbars && this.wrapper.parentNode ) {\n\t\t\tthis.wrapper.parentNode.removeChild(this.wrapper);\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tthis.transitionTime();\n\n\t\tthis.initiated = true;\n\t\tthis.moved = false;\n\t\tthis.lastPointX\t= point.pageX;\n\t\tthis.lastPointY\t= point.pageY;\n\n\t\tthis.startTime\t= utils.getTime();\n\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(window, 'touchmove', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(window, 'mousemove', this);\n\t\t}\n\n\t\tthis.scroller._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tdeltaX, deltaY,\n\t\t\tnewX, newY,\n\t\t\ttimestamp = utils.getTime();\n\n\t\tif ( !this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tdeltaX = point.pageX - this.lastPointX;\n\t\tthis.lastPointX = point.pageX;\n\n\t\tdeltaY = point.pageY - this.lastPointY;\n\t\tthis.lastPointY = point.pageY;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\tthis._pos(newX, newY);\n\n// INSERT POINT: indicator._move\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.initiated = false;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tutils.removeEvent(window, 'touchmove', this);\n\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\tif ( this.scroller.options.snap ) {\n\t\t\tvar snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);\n\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.x - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.y - snap.y), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tif ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {\n\t\t\t\tthis.scroller.directionX = 0;\n\t\t\t\tthis.scroller.directionY = 0;\n\t\t\t\tthis.scroller.currentPage = snap;\n\t\t\t\tthis.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\ttransitionTime: function (time) {\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.indicatorStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.indicatorStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.indicatorStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.indicatorStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\ttransitionTimingFunction: function (easing) {\n\t\tthis.indicatorStyle[utils.style.transitionTimingFunction] = easing;\n\t},\n\n\trefresh: function () {\n\t\tthis.transitionTime();\n\n\t\tif ( this.options.listenX && !this.options.listenY ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';\n\t\t} else if ( this.options.listenY && !this.options.listenX ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t} else {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t}\n\n\t\tif ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {\n\t\t\tutils.addClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.removeClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '8px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '8px';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tutils.removeClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.addClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '2px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '2px';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tutils.getRect(this.wrapper);\t// force refresh\n\n\t\tif ( this.options.listenX ) {\n\t\t\tthis.wrapperWidth = this.wrapper.clientWidth;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);\n\t\t\t\tthis.indicatorStyle.width = this.indicatorWidth + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorWidth = this.indicator.clientWidth;\n\t\t\t}\n\n\t\t\tthis.maxPosX = this.wrapperWidth - this.indicatorWidth;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryX = -this.indicatorWidth + 8;\n\t\t\t\tthis.maxBoundaryX = this.wrapperWidth - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryX = 0;\n\t\t\t\tthis.maxBoundaryX = this.maxPosX;\n\t\t\t}\n\n\t\t\tthis.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));\n\t\t}\n\n\t\tif ( this.options.listenY ) {\n\t\t\tthis.wrapperHeight = this.wrapper.clientHeight;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);\n\t\t\t\tthis.indicatorStyle.height = this.indicatorHeight + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorHeight = this.indicator.clientHeight;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryY = -this.indicatorHeight + 8;\n\t\t\t\tthis.maxBoundaryY = this.wrapperHeight - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryY = 0;\n\t\t\t\tthis.maxBoundaryY = this.maxPosY;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\t\t\tthis.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY));\n\t\t}\n\n\t\tthis.updatePosition();\n\t},\n\n\tupdatePosition: function () {\n\t\tvar x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,\n\t\t\ty = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;\n\n\t\tif ( !this.options.ignoreBoundaries ) {\n\t\t\tif ( x < this.minBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth + x, 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t}\n\t\t\t\tx = this.minBoundaryX;\n\t\t\t} else if ( x > this.maxBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t\tx = this.maxPosX + this.indicatorWidth - this.width;\n\t\t\t\t} else {\n\t\t\t\t\tx = this.maxBoundaryX;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {\n\t\t\t\tthis.width = this.indicatorWidth;\n\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t}\n\n\t\t\tif ( y < this.minBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight + y * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t}\n\t\t\t\ty = this.minBoundaryY;\n\t\t\t} else if ( y > this.maxBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t\ty = this.maxPosY + this.indicatorHeight - this.height;\n\t\t\t\t} else {\n\t\t\t\t\ty = this.maxBoundaryY;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {\n\t\t\t\tthis.height = this.indicatorHeight;\n\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t}\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tif ( this.scroller.options.useTransform ) {\n\t\t\tthis.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;\n\t\t} else {\n\t\t\tthis.indicatorStyle.left = x + 'px';\n\t\t\tthis.indicatorStyle.top = y + 'px';\n\t\t}\n\t},\n\n\t_pos: function (x, y) {\n\t\tif ( x < 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x > this.maxPosX ) {\n\t\t\tx = this.maxPosX;\n\t\t}\n\n\t\tif ( y < 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y > this.maxPosY ) {\n\t\t\ty = this.maxPosY;\n\t\t}\n\n\t\tx = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;\n\t\ty = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;\n\n\t\tthis.scroller.scrollTo(x, y);\n\t},\n\n\tfade: function (val, hold) {\n\t\tif ( hold && !this.visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(this.fadeTimeout);\n\t\tthis.fadeTimeout = null;\n\n\t\tvar time = val ? 250 : 500,\n\t\t\tdelay = val ? 0 : 300;\n\n\t\tval = val ? '1' : '0';\n\n\t\tthis.wrapperStyle[utils.style.transitionDuration] = time + 'ms';\n\n\t\tthis.fadeTimeout = setTimeout((function (val) {\n\t\t\tthis.wrapperStyle.opacity = val;\n\t\t\tthis.visible = +val;\n\t\t}).bind(this, val), delay);\n\t}\n};\n\nIScroll.utils = utils;\n\nif ( typeof module != 'undefined' && module.exports ) {\n\tmodule.exports = IScroll;\n} else if ( typeof define == 'function' && define.amd ) {\n        define( function () { return IScroll; } );\n} else {\n\twindow.IScroll = IScroll;\n}\n\n})(window, document, Math);\n"
  },
  {
    "path": "build.js",
    "content": "#!/usr/bin/env node\n\nvar pkg = require('./package.json');\nvar fs = require('fs');\nvar hint = require(\"jshint\").JSHINT;\nvar uglify = require('uglify-js');\n\nvar banner = '/*! iScroll v' + pkg.version + ' ~ (c) 2008-' + (new Date().getFullYear()) + ' Matteo Spinelli ~ http://cubiq.org/license */\\n';\n\nvar releases = {\n\tlite: {\n\t\tfiles: [\n\t\t\t'default/_animate.js',\n\t\t\t'default/handleEvent.js'\n\t\t]\n\t},\n\n\tiscroll: {\n\t\tfiles: [\n\t\t\t'indicator/_initIndicators.js',\n\t\t\t'wheel/wheel.js',\n\t\t\t'snap/snap.js',\n\t\t\t'keys/keys.js',\n\t\t\t'default/_animate.js',\n\t\t\t'default/handleEvent.js',\n\t\t\t'indicator/indicator.js'\n\t\t],\n\t\tpostProcessing: [ 'indicator/build.json', 'wheel/build.json', 'snap/build.json', 'keys/build.json' ]\n\t},\n\n\tprobe: {\n\t\tfiles: [\n\t\t\t'indicator/_initIndicators.js',\n\t\t\t'wheel/wheel.js',\n\t\t\t'snap/snap.js',\n\t\t\t'keys/keys.js',\n\t\t\t'probe/_animate.js',\n\t\t\t'default/handleEvent.js',\n\t\t\t'indicator/indicator.js'\n\t\t],\n\t\tpostProcessing: [ 'indicator/build.json', 'wheel/build.json', 'snap/build.json', 'keys/build.json', 'probe/build.json' ]\n\t},\n\n\tzoom: {\n\t\tfiles: [\n\t\t\t'indicator/_initIndicators.js',\n\t\t\t'zoom/zoom.js',\n\t\t\t'wheel/wheel.js',\n\t\t\t'snap/snap.js',\n\t\t\t'keys/keys.js',\n\t\t\t'default/_animate.js',\n\t\t\t'zoom/handleEvent.js',\n\t\t\t'indicator/indicator.js'\n\t\t],\n\t\tpostProcessing: [ 'zoom/build.json', 'indicator/build.json', 'wheel/build.json', 'snap/build.json', 'keys/build.json' ]\n\t},\n\n\tinfinite: {\n\t\tfiles: [\n\t\t\t'wheel/wheel.js',\n\t\t\t'snap/snap.js',\n\t\t\t'keys/keys.js',\n\t\t\t'probe/_animate.js',\n\t\t\t'infinite/infinite.js',\n\t\t\t'default/handleEvent.js',\n\t\t],\n\t\tpostProcessing: [ 'wheel/build.json', 'snap/build.json', 'keys/build.json', 'infinite/build.json', 'probe/build.json' ]\n\t}\n};\n\nvar args = process.argv.slice(2);\n\nif ( !args.length ) {\n\targs = ['iscroll'];\n}\n\nif ( args[0] == 'dist' ) {\n\targs = ['lite', 'iscroll', 'zoom', 'probe', 'infinite'];\n}\n\n// Get the list of files\nargs.forEach(function (release) {\n\tif ( !(release in releases) ) {\n\t\tconsole.log('Unrecognized release: ' + release);\n\t\treturn;\n\t}\n\n\tconsole.log('Building release: ' + release);\n\tbuild(release);\n});\n\nfunction build (release) {\n\tvar out = '';\n\tvar value = '';\n\n\tvar fileList = ['open.js', 'utils.js', 'core.js'];\n\n\tfileList = fileList.concat(releases[release].files);\n\n\tfileList.push('close.js');\n\n\t// Concatenate files\n\tout = banner + fileList.map(function (filePath) {\n\t\t\t\treturn fs.readFileSync('src/' + filePath, 'utf-8');\n\t\t\t}).join('');\n\n\t// Update version\n\tout = out.replace('/* VERSION */', pkg.version);\n\n\t// Post processing\n\tif ( releases[release].postProcessing ) {\n\t\treleases[release].postProcessing.forEach(function (file) {\n\t\t\tvar postProcessing = require('./src/' + file);\n\n\t\t\t// Insert point\n\t\t\tfor ( var i in postProcessing.insert ) {\n\t\t\t\tvalue = postProcessing.insert[i].substr(postProcessing.insert[i].length-3) == '.js' ? \n\t\t\t\t\tfs.readFileSync('src/' + postProcessing.insert[i]) :\n\t\t\t\t\tpostProcessing.insert[i];\n\n\t\t\t\tout = out.replace('// INSERT POINT: ' + i, value + '\\n\\n// INSERT POINT: ' + i );\n\t\t\t}\n\n\t\t\t// Replace\n\t\t\tfor ( i in postProcessing.replace ) {\n\t\t\t\tvalue = postProcessing.replace[i].substr(postProcessing.replace[i].length-3) == '.js' ?\n\t\t\t\t\tfs.readFileSync('src/' + postProcessing.replace[i]) :\n\t\t\t\t\tpostProcessing.replace[i];\n\n\t\t\t\tvar regex = new RegExp('\\\\/\\\\* REPLACE START: ' + i + ' \\\\*\\\\/[\\\\s\\\\S]*\\\\/\\\\* REPLACE END: ' + i + ' \\\\*\\\\/');\n\t\t\t\tout = out.replace(regex, '/* REPLACE START: ' + i + ' */' + value + '/* REPLACE END: ' + i + ' */');\n\t\t\t}\n\t\t});\n\t}\n\n\t// Write build file\n\tvar buildFile = './build/iscroll' + (release != 'iscroll' ? '-' + release : '') + '.js';\n\tfs.writeFileSync(buildFile, out);\n\n\t// JSHint\n\tif ( !hint(out) ) {\n\t\tvar lines = out.split('\\n');\n\t\thint.errors.forEach(function (err) {\n\t\t\tconsole.log('\\033[31m[' + err.code + ']\\033[0m ' + err.line + ':' + err.character + '\\t- ' + err.reason);\n\t\t\tconsole.log('\\033[33m' + lines[err.line-1].replace(/\\t/g, ' ') + '\\033[0m\\n');\n\t\t});\n\n\t\tprocess.exit();\n\t}\n\n\t// Write dist file\n\tvar distFile = buildFile.replace('/build/', '/dist/').replace('.js', '-min.js');\n\tout = uglify.minify(out, { fromString: true });\n\n\t// Make sure dist folder exists\n\tif ( !fs.existsSync('dist') ) {\n\t\tfs.mkdirSync('dist');\n\t}\n\n\t// Write files to target\n\tfs.writeFileSync(distFile, banner + out.code);\n}\n"
  },
  {
    "path": "demos/2d-scroll/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: 2d scroll</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { scrollX: true, freeScroll: true });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 2000px;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n\tbackground: #fff;\n}\n\np {\n\tfont-size: 16px;\n\tpadding: 1.2em;\n\tline-height: 200%;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n\t\t<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n\t\t<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n\t\t<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n\t\t<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n\t\t<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/barebone/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: barebone</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper');\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style>\nbody {\n\t/* On modern browsers, prevent the whole page to bounce */\n\toverflow: hidden;\n}\n\n#wrapper {\n\tposition: relative;\n\twidth: 300px;\n\theight: 300px;\n\toverflow: hidden;\n\n\t/* Prevent native touch events on Windows */\n\t-ms-touch-action: none;\n\n\t/* Prevent the callout on tap-hold and text selection */\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\n\t/* Prevent text resize on orientation change, useful for web-apps */\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller {\n\tposition: absolute;\n\n\t/* Prevent elements to be highlighted on tap */\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\n\t/* Put the scroller into the HW Compositing layer right from the start */\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n}\n</style>\n\n</head>\n<body onload=\"loaded()\">\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<p><strong>This demo shows the minimum CSS/HTML/JS configuration you need to run the iScroll. Look at the source code for details.</strong></p>\n\n\t\t<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n\t\t<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p>\n\n\t\t<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p>\n\t</div>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/bounce-easing/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: bounce easing</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { bounceEasing: 'elastic', bounceTime: 1200 });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/carousel/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: carousel</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', {\n\t\tscrollX: true,\n\t\tscrollY: false,\n\t\tmomentum: false,\n\t\tsnap: true,\n\t\tsnapSpeed: 400,\n\t\tkeyBindings: true,\n\t\tindicators: {\n\t\t\tel: document.getElementById('indicator'),\n\t\t\tresize: false\n\t\t}\n\t});\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody, ul, li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#viewport {\n\tposition: relative;\n\twidth: 320px;\n\theight: 240px;\n\tmargin: 0 auto;\n\tbackground: #444;\n\toverflow: hidden;\n}\n\n#wrapper {\n\twidth: 200px;\n\theight: 240px;\n\tmargin: 0 auto;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 800px;\n\theight: 240px;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n\tbackground-color: #444;\n}\n\n.slide {\n\twidth: 200px;\n\theight: 240px;\n\tfloat: left;\n}\n\n.painting {\n\twidth: 140px;\n\theight: 200px;\n\tborder-radius: 10px;\n\tmargin: 20px auto;\n\tborder: 1px solid #000;\n\tbox-shadow:\n\t\tinset 2px 2px 6px rgba(255,255,255,0.6),\n\t\tinset -2px -2px 6px rgba(0,0,0,0.6),\n\t\t0 1px 8px rgba(0,0,0,0.8);\n}\n\n.giotto {\n\tbackground: url(giotto.jpg);\n}\n\n.leonardo {\n\tbackground: url(leonardo.jpg);\n}\n\n.gaugin {\n\tbackground: url(gaugin.jpg);\n}\n\n.warhol {\n\tbackground: url(warhol.jpg);\n}\n\n#indicator {\n\tposition: relative;\n\twidth: 110px;\n\theight: 20px;\n\tmargin: 10px auto;\n\tbackground: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAUBAMAAABohZD3AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QUGCDYztyDUJgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAAGFBMVEUAAADNzc3Nzc3Nzc3Nzc3Nzc3Nzc3///8aWwwLAAAABnRSTlMAX5Ks3/nRD0HIAAAAAWJLR0QHFmGI6wAAAFtJREFUGFdjYGBgEHYNMWRAAJE0IHCEc5nSwEABxleD8JOgXMY0KBCA8FlgfAcIXwzGT4TwzWD8ZAjfDcZPgfDDYPxU7Hx09ejmoduH7h5096L7B8O/6OGBGl4APYg8TQ0XAScAAAAASUVORK5CYII=);\n}\n\n#dotty {\n\tposition: absolute;\n\twidth: 20px;\n\theight: 20px;\n\tborder-radius: 10px;\n\tbackground: #777;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n\n<div id=\"viewport\">\n\t<div id=\"wrapper\">\n\t\t<div id=\"scroller\">\n\t\t\t<div class=\"slide\">\n\t\t\t\t<div class=\"painting giotto\"></div>\n\t\t\t</div>\n\t\t\t<div class=\"slide\">\n\t\t\t\t<div class=\"painting leonardo\"></div>\n\t\t\t</div>\n\t\t\t<div class=\"slide\">\n\t\t\t\t<div class=\"painting gaugin\"></div>\n\t\t\t</div>\n\t\t\t<div class=\"slide\">\n\t\t\t\t<div class=\"painting warhol\"></div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n\n<div id=\"indicator\">\n\t<div id=\"dotty\"></div>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/click/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: click</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { mouseWheel: true, click: true });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li id=\"me\"><a href=\"#\" onclick=\"console.log(this.parentNode.style.backgroundColor);this.parentNode.style.backgroundColor=this.parentNode.style.backgroundColor==''?'#a00':'';return false\">Click me!</a></li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/demoUtils.js",
    "content": "// ref https://github.com/WICG/EventListenerOptions/pull/30\nfunction isPassive() {\n    var supportsPassiveOption = false;\n    try {\n        addEventListener(\"test\", null, Object.defineProperty({}, 'passive', {\n            get: function () {\n                supportsPassiveOption = true;\n            }\n        }));\n    } catch(e) {}\n    return supportsPassiveOption;\n}\n  \t\t  "
  },
  {
    "path": "demos/event-passthrough/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: Event Passthrough</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { eventPassthrough: true, scrollX: true, scrollY: false, preventDefault: false });\n}\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n}\n\n#header {\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#wrapper {\n\tposition: relative;\n\tz-index: 1;\n\theight: 160px;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n\t-ms-touch-action: none;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 2400px;\n\theight: 160px;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\twidth: 100%;\n\tpadding: 0;\n\tmargin: 0;\n}\n\n#scroller li {\n\twidth: 120px;\n\theight: 160px;\n\tfloat: left;\n\tline-height: 160px;\n\tborder-right: 1px solid #ccc;\n\tborder-bottom: 1px solid #ccc;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n\toverflow: hidden;\n\ttext-align: center;\n}\n\np {\n\tfont-size: 16px;\n\tpadding: 1.2em;\n\tline-height: 200%;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty cell 1</li>\n\t\t\t<li>Pretty cell 2</li>\n\t\t\t<li>Pretty cell 3</li>\n\t\t\t<li>Pretty cell 4</li>\n\t\t\t<li>Pretty cell 5</li>\n\t\t\t<li>Pretty cell 6</li>\n\t\t\t<li>Pretty cell 7</li>\n\t\t\t<li>Pretty cell 8</li>\n\t\t\t<li>Pretty cell 9</li>\n\t\t\t<li>Pretty cell 10</li>\n\t\t\t<li>Pretty cell 11</li>\n\t\t\t<li>Pretty cell 12</li>\n\t\t\t<li>Pretty cell 13</li>\n\t\t\t<li>Pretty cell 14</li>\n\t\t\t<li>Pretty cell 15</li>\n\t\t\t<li>Pretty cell 16</li>\n\t\t\t<li>Pretty cell 17</li>\n\t\t\t<li>Pretty cell 18</li>\n\t\t\t<li>Pretty cell 19</li>\n\t\t\t<li>Pretty cell 20</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>\n\n</body>\n</html>"
  },
  {
    "path": "demos/forms/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: simple</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { mouseWheel: true });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li><input type=\"text\"></li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li><input type=\"checkbox\"></li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li><input type=\"radio\"></li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li><textarea></textarea></li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li><select><option>option</option></select></li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/horizontal/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: horizontal scrolling</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { scrollX: true, scrollY: false, mouseWheel: true });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 5000px;\n\theight: 100%;\n\tbackground-color: #a00;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\theight: 100%;\n\ttext-align: center;\n}\n\n#scroller li {\n\tdisplay: block;\n\tfloat: left;\n\twidth: 100px;\n\theight: 100%;\n\tborder-right: 1px solid #ccc;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Cell 1</li>\n\t\t\t<li>Cell 2</li>\n\t\t\t<li>Cell 3</li>\n\t\t\t<li>Cell 4</li>\n\t\t\t<li>Cell 5</li>\n\t\t\t<li>Cell 6</li>\n\t\t\t<li>Cell 7</li>\n\t\t\t<li>Cell 8</li>\n\t\t\t<li>Cell 9</li>\n\t\t\t<li>Cell 10</li>\n\t\t\t<li>Cell 11</li>\n\t\t\t<li>Cell 12</li>\n\t\t\t<li>Cell 13</li>\n\t\t\t<li>Cell 14</li>\n\t\t\t<li>Cell 15</li>\n\t\t\t<li>Cell 16</li>\n\t\t\t<li>Cell 17</li>\n\t\t\t<li>Cell 18</li>\n\t\t\t<li>Cell 19</li>\n\t\t\t<li>Cell 20</li>\n\t\t\t<li>Cell 21</li>\n\t\t\t<li>Cell 22</li>\n\t\t\t<li>Cell 23</li>\n\t\t\t<li>Cell 24</li>\n\t\t\t<li>Cell 25</li>\n\t\t\t<li>Cell 26</li>\n\t\t\t<li>Cell 27</li>\n\t\t\t<li>Cell 28</li>\n\t\t\t<li>Cell 29</li>\n\t\t\t<li>Cell 30</li>\n\t\t\t<li>Cell 31</li>\n\t\t\t<li>Cell 32</li>\n\t\t\t<li>Cell 33</li>\n\t\t\t<li>Cell 34</li>\n\t\t\t<li>Cell 35</li>\n\t\t\t<li>Cell 36</li>\n\t\t\t<li>Cell 37</li>\n\t\t\t<li>Cell 38</li>\n\t\t\t<li>Cell 39</li>\n\t\t\t<li>Cell 40</li>\n\t\t\t<li>Cell 41</li>\n\t\t\t<li>Cell 42</li>\n\t\t\t<li>Cell 43</li>\n\t\t\t<li>Cell 44</li>\n\t\t\t<li>Cell 45</li>\n\t\t\t<li>Cell 46</li>\n\t\t\t<li>Cell 47</li>\n\t\t\t<li>Cell 48</li>\n\t\t\t<li>Cell 49</li>\n\t\t\t<li>Cell 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/infinite/dataset.php",
    "content": "<?php\n//header('Cache-Control: no-cache, must-revalidate');\n//header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\nheader('Content-type: application/json');\n\n$start = isset($_GET['start']) ? (int)$_GET['start'] : 0;\n$count = isset($_GET['count']) ? min((int)$_GET['count'], 2000) : 100;\n\n$data = array();\nfor ( $i = $start; $i < $start+$count; $i++ ) {\n\t$data[] = $i;\n}\n\necho json_encode($data);\n"
  },
  {
    "path": "demos/infinite/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: infinite scrolling</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll-infinite.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n/******************************************************************************\n *\n * For the sake of keeping the script dependecy free I'm including a custom\n * AJAX function. You should probably use a third party plugin\n *\n */\nfunction ajax (url, parms) {\n\tparms = parms || {};\n\tvar req = new XMLHttpRequest(),\n\t\tpost = parms.post || null,\n\t\tcallback = parms.callback || null,\n\t\ttimeout = parms.timeout || null;\n\n\treq.onreadystatechange = function () {\n\t\tif ( req.readyState != 4 ) return;\n\n\t\t// Error\n\t\tif ( req.status != 200 && req.status != 304 ) {\n\t\t\tif ( callback ) callback(false);\n\t\t\treturn;\n\t\t}\n\n\t\tif ( callback ) callback(req.responseText);\n\t};\n\n\tif ( post ) {\n\t\treq.open('POST', url, true);\n\t\treq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n\t} else {\n\t\treq.open('GET', url, true);\n\t}\n\n\treq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n\n\treq.send(post);\n\n\tif ( timeout ) {\n\t\tsetTimeout(function () {\n\t\t\treq.onreadystatechange = function () {};\n\t\t\treq.abort();\n\t\t\tif ( callback ) callback(false);\n\t\t}, timeout);\n\t}\n}\n/*\n *****************************************************************************/\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', {\n\t\tmouseWheel: true,\n\t\tinfiniteElements: '#scroller .row',\n\t\t//infiniteLimit: 2000,\n\t\tdataset: requestData,\n\t\tdataFiller: updateContent,\n\t\tcacheSize: 1000\n\t});\n}\n\nfunction requestData (start, count) {\n\tajax('dataset.php?start=' + +start + '&count=' + +count, {\n\t\tcallback: function (data) {\n\t\t\tdata = JSON.parse(data);\n\t\t\tmyScroll.updateCache(start, data);\n\t\t}\n\t});\n}\n\nfunction updateContent (el, data) {\n\tel.innerHTML = data;\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n\tposition: relative;\n}\n\n#scroller li {\n\tposition: absolute;\n\twidth: 100%;\n\ttop: 0;\n\tleft: 0;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 16px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li class=\"row\">Row 1</li>\n\t\t\t<li class=\"row\">Row 2</li>\n\t\t\t<li class=\"row\">Row 3</li>\n\t\t\t<li class=\"row\">Row 4</li>\n\t\t\t<li class=\"row\">Row 5</li>\n\t\t\t<li class=\"row\">Row 6</li>\n\t\t\t<li class=\"row\">Row 7</li>\n\t\t\t<li class=\"row\">Row 8</li>\n\t\t\t<li class=\"row\">Row 9</li>\n\t\t\t<li class=\"row\">Row 10</li>\n\t\t\t<li class=\"row\">Row 11</li>\n\t\t\t<li class=\"row\">Row 12</li>\n\t\t\t<li class=\"row\">Row 13</li>\n\t\t\t<li class=\"row\">Row 14</li>\n\t\t\t<li class=\"row\">Row 15</li>\n\n\t\t\t<li class=\"row\">Row 16</li>\n\t\t\t<li class=\"row\">Row 17</li>\n\t\t\t<li class=\"row\">Row 18</li>\n\t\t\t<li class=\"row\">Row 19</li>\n\t\t\t<li class=\"row\">Row 20</li>\n\t\t\t<li class=\"row\">Row 21</li>\n\t\t\t<li class=\"row\">Row 22</li>\n\t\t\t<li class=\"row\">Row 23</li>\n\t\t\t<li class=\"row\">Row 24</li>\n\t\t\t<li class=\"row\">Row 25</li>\n\t\t\t<li class=\"row\">Row 26</li>\n\t\t\t<li class=\"row\">Row 27</li>\n\t\t\t<li class=\"row\">Row 28</li>\n\t\t\t<li class=\"row\">Row 29</li>\n\t\t\t<li class=\"row\">Row 30</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/key-bindings/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: key bindings</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { keyBindings: true });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/minimap/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: minimap</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<!--<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>-->\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', {\n\t\tstartX: -359,\n\t\tstartY: -85,\n\t\tscrollY: true,\n\t\tscrollX: true,\n\t\tfreeScroll: true,\n\t\tmouseWheel: true,\n\t\tindicators: {\n\t\t\tel: document.getElementById('minimap'),\n\t\t\tinteractive: true\n\t\t}\n\t});\n}\n\n// document.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n// \tcapture: false,\n// \tpassive: false\n// } : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\twidth: 235px;\n\theight: 321px;\n\ttop: 0;\n\tleft: 0;\n\tbackground: #555;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\twidth: 797px;\n\theight: 1087px;\n\tbackground: url(ermine.jpg);\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#minimap {\n\tposition: absolute;\n\tz-index: 1;\n\twidth: 235px;\n\theight: 321px;\n\tbackground: url(ermine.jpg);\n\tbackground-size: 235px 321px;\n\ttop: 0px;\n\tleft: 245px;\n}\n\n#minimap-indicator {\n\tposition: absolute;\n\tz-index: 1;\n\tborder: 1px solid #fe0;\n\tbox-shadow: 0 0 5px #000;\n\tbackground: rgba(255,255,255,0.15);\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n}\n\n#bookmarks {\n\tposition: absolute;\n\tleft: 520px;\n\tfont-size: 1.4em;\n}\n\n#bookmarks li {\n\tmargin: 5px 0;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\"></div>\n</div>\n\n<div id=\"minimap\">\n\t<div id=\"minimap-indicator\"></div>\n</div>\n\n<ul id=\"bookmarks\">\n\t<li><a href=\"javascript:myScroll.scrollTo(-359, -85, 400, IScroll.utils.ease.back)\">Face</a></li>\n\t<li><a href=\"javascript:myScroll.scrollTo(-288, -342, 400, IScroll.utils.ease.back)\">Necklace</a></li>\n\t<li><a href=\"javascript:myScroll.scrollTo(-264, -658, 400, IScroll.utils.ease.back)\">Hand</a></li>\n\t<li><a href=\"javascript:myScroll.scrollTo(-383, -539, 400, IScroll.utils.ease.back)\">Ermine</a></li>\n</ul>\n\n</body>\n</html>"
  },
  {
    "path": "demos/no-transition/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: No transition</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { useTransition: false });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/parallax/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: starfield</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', {\n\t\tmouseWheel: true,\n\t\tindicators: [{\n\t\t\tel: document.getElementById('starfield1'),\n\t\t\tresize: false,\n\t\t\tignoreBoundaries: true,\n\t\t\tspeedRatioY: 0.4\n\t\t}, {\n\t\t\tel: document.getElementById('starfield2'),\n\t\t\tresize: false,\n\t\t\tignoreBoundaries: true,\n\t\t\tspeedRatioY: 0.2\n\t\t}]\n\t});\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n\tbackground: #000;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 3;\n\twidth: 100%;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 3;\n\twidth: 100%;\n\theight: 4000px;\n\toverflow: hidden;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n\tbackground: url(galaxies1.png);\n}\n\n.starfield {\n\tposition: absolute;\n\twidth: 100%;\n\ttop: 0;\n\tleft: 0;\n\tbottom: 0;\n\toverflow: hidden;\n}\n\n.starfield div {\n\tposition: absolute;\n\twidth: 100%;\n\toverflow: hidden;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n}\n\n#starfield1 {\n\tz-index: 2;\n}\n\n#stars1 {\n\tz-index: 2;\n\theight: 3000px;\n\tbackground: url(galaxies2.png);\n}\n\n#starfield2 {\n\tz-index: 1;\n}\n\n#stars2 {\n\tz-index: 1;\n\theight: 2000px;\n\tbackground: url(stars.jpg);\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\"></div>\n</div>\n\n<div class=\"starfield\" id=\"starfield1\">\n\t<div id=\"stars1\"></div>\n</div>\n\n<div class=\"starfield\" id=\"starfield2\">\n\t<div id=\"stars2\"></div>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/probe/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: probe</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll-probe.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\nvar position;\n\nfunction updatePosition () {\n\tposition.innerHTML = this.y>>0;\n}\n\nfunction loaded () {\n\tposition = document.getElementById('position');\n\n\tmyScroll = new IScroll('#wrapper', { probeType: 3, mouseWheel: true });\n\n\tmyScroll.on('scroll', updatePosition);\n\tmyScroll.on('scrollEnd', updatePosition);\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 0;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 50%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n#monitor {\n\tposition: absolute;\n\tleft: 51%;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n\n<div id=\"monitor\">Y position: <strong id=\"position\">0</strong></div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/scroll-to-element/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: scroll to element</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { mouseWheel: true, click: true });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li><a href=\"javascript:myScroll.scrollToElement(document.querySelector('#scroller li:nth-child(10)'))\">Scroll to element 10</a></li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li><a href=\"javascript:myScroll.scrollToElement(document.querySelector('#scroller li:nth-child(25)'), null, null, true)\">Center element 25 to screen</a></li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li><a href=\"javascript:myScroll.scrollToElement(document.querySelector('#scroller li:nth-child(50)'), 1200, null, null, IScroll.utils.ease.elastic)\">Scroll to the last element with elastic easing</a></li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/scrollbars/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: scrollbars</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', {\n\t\tscrollbars: true,\n\t\tmouseWheel: true,\n\t\tinteractiveScrollbars: true,\n\t\tshrinkScrollbars: 'scale',\n\t\tfadeScrollbars: true\n\t});\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>\n"
  },
  {
    "path": "demos/simple/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: simple</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { mouseWheel: true });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/snap/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: snap</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', {\n\t\tscrollX: true,\n\t\tscrollY: true,\n\t\tmomentum: false,\n\t\tsnap: true\n\t});\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 2000px;\n\theight: 2000px;\n\tbackground-color: #a00;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: center;\n}\n\n#scroller li {\n\tdisplay: block;\n\tfloat: left;\n\twidth: 200px;\n\theight: 200px;\n\tborder-right: 1px solid #ccc;\n\tborder-bottom: 1px solid #ccc;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t\t<li>Cell</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/styled-scrollbars/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: styled scrollbars</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { scrollX: true, scrollbars: 'custom' });\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n\n/* Styled scrollbars */\n\n.iScrollHorizontalScrollbar {\n\tposition: absolute;\n\tz-index: 9999;\n\theight: 16px;\n\tleft: 2px;\n\tright: 2px;\n\tbottom: 2px;\n\toverflow: hidden;\n}\n\n.iScrollHorizontalScrollbar.iScrollBothScrollbars {\n\tright: 18px;\n}\n\n.iScrollVerticalScrollbar {\n\tposition: absolute;\n\tz-index: 9999;\n\twidth: 16px;\n\tbottom: 2px;\n\ttop: 2px;\n\tright: 2px;\n\toverflow: hidden;\n}\n\n.iScrollVerticalScrollbar.iScrollBothScrollbars {\n\tbottom: 18px;\n}\n\n.iScrollIndicator {\n\tposition: absolute;\n\tbackground: #cc3f6e;\n\tborder-width: 1px;\n\tborder-style: solid;\n\tborder-color: #EB97B4 #7C2845 #7C2845 #EB97B4;\n\tborder-radius: 8px;\n}\n\n.iScrollHorizontalScrollbar .iScrollIndicator {\n\theight: 100%;\n\tbackground: -moz-linear-gradient(left,  #cc3f6e 0%, #93004e 100%);\n\tbackground: -webkit-linear-gradient(left,  #cc3f6e 0%,#93004e 100%);\n\tbackground: -o-linear-gradient(left,  #cc3f6e 0%,#93004e 100%);\n\tbackground: -ms-linear-gradient(left,  #cc3f6e 0%,#93004e 100%);\n\tbackground: linear-gradient(to right,  #cc3f6e 0%,#93004e 100%);\n}\n\n.iScrollVerticalScrollbar .iScrollIndicator {\n\twidth: 100%;\n\tbackground: -moz-linear-gradient(top, #cc3f6e 0%, #93004e 100%);\n\tbackground: -webkit-linear-gradient(top,  #cc3f6e 0%,#93004e 100%);\n\tbackground: -o-linear-gradient(top, #cc3f6e 0%,#93004e 100%);\n\tbackground: -ms-linear-gradient(top, #cc3f6e 0%,#93004e 100%);\n\tbackground: linear-gradient(to bottom,  #cc3f6e 0%,#93004e 100%);\n}\n\n\n/* end */\n\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 2000px;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/tap/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: simple</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', { mouseWheel: true, tap: true });\n\n\tdocument.getElementById('me').addEventListener('tap', function () {\n\t\tthis.style.background = !this.style.background ? '#a00' : '';\n\t}, false);\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#header {\n\tposition: absolute;\n\tz-index: 2;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 45px;\n\tline-height: 45px;\n\tbackground: #CD235C;\n\tpadding: 0;\n\tcolor: #eee;\n\tfont-size: 20px;\n\ttext-align: center;\n\tfont-weight: bold;\n}\n\n#footer {\n\tposition: absolute;\n\tz-index: 2;\n\tbottom: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 48px;\n\tbackground: #444;\n\tpadding: 0;\n\tborder-top: 1px solid #444;\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 45px;\n\tbottom: 48px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n<div id=\"header\">iScroll</div>\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li id=\"me\"><strong>Tap me! Tap me! Tap me! Tap me!</strong></li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n<div id=\"footer\"></div>\n\n</body>\n</html>"
  },
  {
    "path": "demos/zoom/index.html",
    "content": "<!DOCTYPE html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0\">\n\n<title>iScroll demo: zoom</title>\n\n<script type=\"text/javascript\" src=\"../../build/iscroll-zoom.js\"></script>\n<script type=\"text/javascript\" src=\"../demoUtils.js\"></script>\n<script type=\"text/javascript\">\n\nvar myScroll;\n\nfunction loaded () {\n\tmyScroll = new IScroll('#wrapper', {\n\t\tzoom: true,\n\t\tscrollX: true,\n\t\tscrollY: true,\n\t\tmouseWheel: true,\n\t\twheelAction: 'zoom'\n\t});\n}\n\ndocument.addEventListener('touchmove', function (e) { e.preventDefault(); }, isPassive() ? {\n\tcapture: false,\n\tpassive: false\n} : false);\n\n</script>\n\n<style type=\"text/css\">\n* {\n\t-webkit-box-sizing: border-box;\n\t-moz-box-sizing: border-box;\n\tbox-sizing: border-box;\n}\n\nhtml {\n\t-ms-touch-action: none;\n}\n\nbody,ul,li {\n\tpadding: 0;\n\tmargin: 0;\n\tborder: 0;\n}\n\nbody {\n\tfont-size: 12px;\n\tfont-family: ubuntu, helvetica, arial;\n\toverflow: hidden; /* this is important to prevent the whole page to bounce */\n}\n\n#wrapper {\n\tposition: absolute;\n\tz-index: 1;\n\ttop: 50px;\n\tbottom: 50px;\n\tleft: 50px;\n\tright: 50px;\n\tbackground: #ccc;\n\toverflow: hidden;\n}\n\n#scroller {\n\tposition: absolute;\n\tz-index: 1;\n\t-webkit-tap-highlight-color: rgba(0,0,0,0);\n\twidth: 100%;\n\t-webkit-transform: translateZ(0);\n\t-moz-transform: translateZ(0);\n\t-ms-transform: translateZ(0);\n\t-o-transform: translateZ(0);\n\ttransform: translateZ(0);\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-text-size-adjust: none;\n\t-moz-text-size-adjust: none;\n\t-ms-text-size-adjust: none;\n\t-o-text-size-adjust: none;\n\ttext-size-adjust: none;\n}\n\n#scroller ul {\n\tlist-style: none;\n\tpadding: 0;\n\tmargin: 0;\n\twidth: 100%;\n\ttext-align: left;\n}\n\n#scroller li {\n\tpadding: 0 10px;\n\theight: 40px;\n\tline-height: 40px;\n\tborder-bottom: 1px solid #ccc;\n\tborder-top: 1px solid #fff;\n\tbackground-color: #fafafa;\n\tfont-size: 14px;\n}\n\n</style>\n</head>\n<body onload=\"loaded()\">\n\n<div id=\"wrapper\">\n\t<div id=\"scroller\">\n\t\t<ul>\n\t\t\t<li>Pretty row 1</li>\n\t\t\t<li>Pretty row 2</li>\n\t\t\t<li>Pretty row 3</li>\n\t\t\t<li>Pretty row 4</li>\n\t\t\t<li>Pretty row 5</li>\n\t\t\t<li>Pretty row 6</li>\n\t\t\t<li>Pretty row 7</li>\n\t\t\t<li>Pretty row 8</li>\n\t\t\t<li>Pretty row 9</li>\n\t\t\t<li>Pretty row 10</li>\n\t\t\t<li>Pretty row 11</li>\n\t\t\t<li>Pretty row 12</li>\n\t\t\t<li>Pretty row 13</li>\n\t\t\t<li>Pretty row 14</li>\n\t\t\t<li>Pretty row 15</li>\n\t\t\t<li>Pretty row 16</li>\n\t\t\t<li>Pretty row 17</li>\n\t\t\t<li>Pretty row 18</li>\n\t\t\t<li>Pretty row 19</li>\n\t\t\t<li>Pretty row 20</li>\n\t\t\t<li>Pretty row 21</li>\n\t\t\t<li>Pretty row 22</li>\n\t\t\t<li>Pretty row 23</li>\n\t\t\t<li>Pretty row 24</li>\n\t\t\t<li>Pretty row 25</li>\n\t\t\t<li>Pretty row 26</li>\n\t\t\t<li>Pretty row 27</li>\n\t\t\t<li>Pretty row 28</li>\n\t\t\t<li>Pretty row 29</li>\n\t\t\t<li>Pretty row 30</li>\n\t\t\t<li>Pretty row 31</li>\n\t\t\t<li>Pretty row 32</li>\n\t\t\t<li>Pretty row 33</li>\n\t\t\t<li>Pretty row 34</li>\n\t\t\t<li>Pretty row 35</li>\n\t\t\t<li>Pretty row 36</li>\n\t\t\t<li>Pretty row 37</li>\n\t\t\t<li>Pretty row 38</li>\n\t\t\t<li>Pretty row 39</li>\n\t\t\t<li>Pretty row 40</li>\n\t\t\t<li>Pretty row 41</li>\n\t\t\t<li>Pretty row 42</li>\n\t\t\t<li>Pretty row 43</li>\n\t\t\t<li>Pretty row 44</li>\n\t\t\t<li>Pretty row 45</li>\n\t\t\t<li>Pretty row 46</li>\n\t\t\t<li>Pretty row 47</li>\n\t\t\t<li>Pretty row 48</li>\n\t\t\t<li>Pretty row 49</li>\n\t\t\t<li>Pretty row 50</li>\n\t\t</ul>\n\t</div>\n</div>\n\n</body>\n</html>"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"iscroll\",\n  \"description\": \"Smooth scrolling for the web\",\n  \"version\": \"5.2.0-snapshot\",\n  \"homepage\": \"http://iscrolljs.com\",\n  \"author\": \"Matteo Spinelli <matteo@cubiq.org> (http://cubiq.org)\",\n  \"keywords\": [\n    \"scrolling\",\n    \"carousel\",\n    \"zoom\",\n    \"iphone\",\n    \"android\",\n    \"mobile\",\n    \"desktop\"\n  ],\n  \"main\": \"build/iscroll.js\",\n  \"devDependencies\": {\n    \"jshint\": \"~2.9.1\",\n    \"uglify-js\": \"~2.6.2\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/cubiq/iscroll.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/cubiq/iscroll/issues\"\n  },\n  \"license\": \"MIT\"\n}\n"
  },
  {
    "path": "src/close.js",
    "content": "\nIScroll.utils = utils;\n\nif ( typeof module != 'undefined' && module.exports ) {\n\tmodule.exports = IScroll;\n} else if ( typeof define == 'function' && define.amd ) {\n        define( function () { return IScroll; } );\n} else {\n\twindow.IScroll = IScroll;\n}\n\n})(window, document, Math);\n"
  },
  {
    "path": "src/core.js",
    "content": "\nfunction IScroll (el, options) {\n\tthis.wrapper = typeof el == 'string' ? document.querySelector(el) : el;\n\tthis.scroller = this.wrapper.children[0];\n\tthis.scrollerStyle = this.scroller.style;\t\t// cache style for better performance\n\n\tthis.options = {\n\n// INSERT POINT: OPTIONS\n\t\tdisablePointer : !utils.hasPointer,\n\t\tdisableTouch : utils.hasPointer || !utils.hasTouch,\n\t\tdisableMouse : utils.hasPointer || utils.hasTouch,\n\t\tstartX: 0,\n\t\tstartY: 0,\n\t\tscrollY: true,\n\t\tdirectionLockThreshold: 5,\n\t\tmomentum: true,\n\n\t\tbounce: true,\n\t\tbounceTime: 600,\n\t\tbounceEasing: '',\n\n\t\tpreventDefault: true,\n\t\tpreventDefaultException: { tagName: /^(INPUT|TEXTAREA|BUTTON|SELECT)$/ },\n\n\t\tHWCompositing: true,\n\t\tuseTransition: true,\n\t\tuseTransform: true,\n\t\tbindToWrapper: typeof window.onmousedown === \"undefined\"\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\t// Normalize options\n\tthis.translateZ = this.options.HWCompositing && utils.hasPerspective ? ' translateZ(0)' : '';\n\n\tthis.options.useTransition = utils.hasTransition && this.options.useTransition;\n\tthis.options.useTransform = utils.hasTransform && this.options.useTransform;\n\n\tthis.options.eventPassthrough = this.options.eventPassthrough === true ? 'vertical' : this.options.eventPassthrough;\n\tthis.options.preventDefault = !this.options.eventPassthrough && this.options.preventDefault;\n\n\t// If you want eventPassthrough I have to lock one of the axes\n\tthis.options.scrollY = this.options.eventPassthrough == 'vertical' ? false : this.options.scrollY;\n\tthis.options.scrollX = this.options.eventPassthrough == 'horizontal' ? false : this.options.scrollX;\n\n\t// With eventPassthrough we also need lockDirection mechanism\n\tthis.options.freeScroll = this.options.freeScroll && !this.options.eventPassthrough;\n\tthis.options.directionLockThreshold = this.options.eventPassthrough ? 0 : this.options.directionLockThreshold;\n\n\tthis.options.bounceEasing = typeof this.options.bounceEasing == 'string' ? utils.ease[this.options.bounceEasing] || utils.ease.circular : this.options.bounceEasing;\n\n\tthis.options.resizePolling = this.options.resizePolling === undefined ? 60 : this.options.resizePolling;\n\n\tif ( this.options.tap === true ) {\n\t\tthis.options.tap = 'tap';\n\t}\n\n\t// https://github.com/cubiq/iscroll/issues/1029\n\tif (!this.options.useTransition && !this.options.useTransform) {\n\t\tif(!(/relative|absolute/i).test(this.scrollerStyle.position)) {\n\t\t\tthis.scrollerStyle.position = \"relative\";\n\t\t}\n\t}\n\n// INSERT POINT: NORMALIZATION\n\n\t// Some defaults\n\tthis.x = 0;\n\tthis.y = 0;\n\tthis.directionX = 0;\n\tthis.directionY = 0;\n\tthis._events = {};\n\n// INSERT POINT: DEFAULTS\n\n\tthis._init();\n\tthis.refresh();\n\n\tthis.scrollTo(this.options.startX, this.options.startY);\n\tthis.enable();\n}\n\nIScroll.prototype = {\n\tversion: '/* VERSION */',\n\n\t_init: function () {\n\t\tthis._initEvents();\n\n// INSERT POINT: _init\n\n\t},\n\n\tdestroy: function () {\n\t\tthis._initEvents(true);\n\t\tclearTimeout(this.resizeTimeout);\n \t\tthis.resizeTimeout = null;\n\t\tthis._execEvent('destroy');\n\t},\n\n\t_transitionEnd: function (e) {\n\t\tif ( e.target != this.scroller || !this.isInTransition ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._transitionTime();\n\t\tif ( !this.resetPosition(this.options.bounceTime) ) {\n\t\t\tthis.isInTransition = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\t// React to left mouse button only\n\t\tif ( utils.eventType[e.type] != 1 ) {\n\t\t  // for button property\n\t\t  // http://unixpapa.com/js/mouse.html\n\t\t  var button;\n\t    if (!e.which) {\n\t      /* IE case */\n\t      button = (e.button < 2) ? 0 :\n\t               ((e.button == 4) ? 1 : 2);\n\t    } else {\n\t      /* All others */\n\t      button = e.button;\n\t    }\n\t\t\tif ( button !== 0 ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif ( !this.enabled || (this.initiated && utils.eventType[e.type] !== this.initiated) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tpos;\n\n\t\tthis.initiated\t= utils.eventType[e.type];\n\t\tthis.moved\t\t= false;\n\t\tthis.distX\t\t= 0;\n\t\tthis.distY\t\t= 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\tthis.directionLocked = 0;\n\n\t\tthis.startTime = utils.getTime();\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tthis._transitionTime();\n\t\t\tthis.isInTransition = false;\n\t\t\tpos = this.getComputedPosition();\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis._execEvent('scrollEnd');\n\t\t} else if ( !this.options.useTransition && this.isAnimating ) {\n\t\t\tthis.isAnimating = false;\n\t\t\tthis._execEvent('scrollEnd');\n\t\t}\n\n\t\tthis.startX    = this.x;\n\t\tthis.startY    = this.y;\n\t\tthis.absStartX = this.x;\n\t\tthis.absStartY = this.y;\n\t\tthis.pointX    = point.pageX;\n\t\tthis.pointY    = point.pageY;\n\n\t\tthis._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\t// increases performance on Android? TODO: check!\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point\t\t= e.touches ? e.touches[0] : e,\n\t\t\tdeltaX\t\t= point.pageX - this.pointX,\n\t\t\tdeltaY\t\t= point.pageY - this.pointY,\n\t\t\ttimestamp\t= utils.getTime(),\n\t\t\tnewX, newY,\n\t\t\tabsDistX, absDistY;\n\n\t\tthis.pointX\t\t= point.pageX;\n\t\tthis.pointY\t\t= point.pageY;\n\n\t\tthis.distX\t\t+= deltaX;\n\t\tthis.distY\t\t+= deltaY;\n\t\tabsDistX\t\t= Math.abs(this.distX);\n\t\tabsDistY\t\t= Math.abs(this.distY);\n\n\t\t// We need to move at least 10 pixels for the scrolling to initiate\n\t\tif ( timestamp - this.endTime > 300 && (absDistX < 10 && absDistY < 10) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// If you are scrolling in one direction lock the other\n\t\tif ( !this.directionLocked && !this.options.freeScroll ) {\n\t\t\tif ( absDistX > absDistY + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'h';\t\t// lock horizontally\n\t\t\t} else if ( absDistY >= absDistX + this.options.directionLockThreshold ) {\n\t\t\t\tthis.directionLocked = 'v';\t\t// lock vertically\n\t\t\t} else {\n\t\t\t\tthis.directionLocked = 'n';\t\t// no lock\n\t\t\t}\n\t\t}\n\n\t\tif ( this.directionLocked == 'h' ) {\n\t\t\tif ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaY = 0;\n\t\t} else if ( this.directionLocked == 'v' ) {\n\t\t\tif ( this.options.eventPassthrough == 'horizontal' ) {\n\t\t\t\te.preventDefault();\n\t\t\t} else if ( this.options.eventPassthrough == 'vertical' ) {\n\t\t\t\tthis.initiated = false;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdeltaX = 0;\n\t\t}\n\n\t\tdeltaX = this.hasHorizontalScroll ? deltaX : 0;\n\t\tdeltaY = this.hasVerticalScroll ? deltaY : 0;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\t// Slow down if outside of the boundaries\n\t\tif ( newX > 0 || newX < this.maxScrollX ) {\n\t\t\tnewX = this.options.bounce ? this.x + deltaX / 3 : newX > 0 ? 0 : this.maxScrollX;\n\t\t}\n\t\tif ( newY > 0 || newY < this.maxScrollY ) {\n\t\t\tnewY = this.options.bounce ? this.y + deltaY / 3 : newY > 0 ? 0 : this.maxScrollY;\n\t\t}\n\n\t\tthis.directionX = deltaX > 0 ? -1 : deltaX < 0 ? 1 : 0;\n\t\tthis.directionY = deltaY > 0 ? -1 : deltaY < 0 ? 1 : 0;\n\n\t\tif ( !this.moved ) {\n\t\t\tthis._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tthis._translate(newX, newY);\n\n/* REPLACE START: _move */\n\n\t\tif ( timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.startX = this.x;\n\t\t\tthis.startY = this.y;\n\t\t}\n\n/* REPLACE END: _move */\n\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar point = e.changedTouches ? e.changedTouches[0] : e,\n\t\t\tmomentumX,\n\t\t\tmomentumY,\n\t\t\tduration = utils.getTime() - this.startTime,\n\t\t\tnewX = Math.round(this.x),\n\t\t\tnewY = Math.round(this.y),\n\t\t\tdistanceX = Math.abs(newX - this.startX),\n\t\t\tdistanceY = Math.abs(newY - this.startY),\n\t\t\ttime = 0,\n\t\t\teasing = '';\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\t\tthis.endTime = utils.getTime();\n\n\t\t// reset if we are outside of the boundaries\n\t\tif ( this.resetPosition(this.options.bounceTime) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY);\t// ensures that the last position is rounded\n\n\t\t// we scrolled less than 10 pixels\n\t\tif ( !this.moved ) {\n\t\t\tif ( this.options.tap ) {\n\t\t\t\tutils.tap(e, this.options.tap);\n\t\t\t}\n\n\t\t\tif ( this.options.click ) {\n\t\t\t\tutils.click(e);\n\t\t\t}\n\n\t\t\tthis._execEvent('scrollCancel');\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this._events.flick && duration < 200 && distanceX < 100 && distanceY < 100 ) {\n\t\t\tthis._execEvent('flick');\n\t\t\treturn;\n\t\t}\n\n\t\t// start momentum animation if needed\n\t\tif ( this.options.momentum && duration < 300 ) {\n\t\t\tmomentumX = this.hasHorizontalScroll ? utils.momentum(this.x, this.startX, duration, this.maxScrollX, this.options.bounce ? this.wrapperWidth : 0, this.options.deceleration) : { destination: newX, duration: 0 };\n\t\t\tmomentumY = this.hasVerticalScroll ? utils.momentum(this.y, this.startY, duration, this.maxScrollY, this.options.bounce ? this.wrapperHeight : 0, this.options.deceleration) : { destination: newY, duration: 0 };\n\t\t\tnewX = momentumX.destination;\n\t\t\tnewY = momentumY.destination;\n\t\t\ttime = Math.max(momentumX.duration, momentumY.duration);\n\t\t\tthis.isInTransition = 1;\n\t\t}\n\n// INSERT POINT: _end\n\n\t\tif ( newX != this.x || newY != this.y ) {\n\t\t\t// change easing function when scroller goes out of the boundaries\n\t\t\tif ( newX > 0 || newX < this.maxScrollX || newY > 0 || newY < this.maxScrollY ) {\n\t\t\t\teasing = utils.ease.quadratic;\n\t\t\t}\n\n\t\t\tthis.scrollTo(newX, newY, time, easing);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._execEvent('scrollEnd');\n\t},\n\n\t_resize: function () {\n\t\tvar that = this;\n\n\t\tclearTimeout(this.resizeTimeout);\n\n\t\tthis.resizeTimeout = setTimeout(function () {\n\t\t\tthat.refresh();\n\t\t}, this.options.resizePolling);\n\t},\n\n\tresetPosition: function (time) {\n\t\tvar x = this.x,\n\t\t\ty = this.y;\n\n\t\ttime = time || 0;\n\n\t\tif ( !this.hasHorizontalScroll || this.x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( this.x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll || this.y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( this.y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tif ( x == this.x && y == this.y ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time, this.options.bounceEasing);\n\n\t\treturn true;\n\t},\n\n\tdisable: function () {\n\t\tthis.enabled = false;\n\t},\n\n\tenable: function () {\n\t\tthis.enabled = true;\n\t},\n\n\trefresh: function () {\n\t\tutils.getRect(this.wrapper);\t\t// Force reflow\n\n\t\tthis.wrapperWidth\t= this.wrapper.clientWidth;\n\t\tthis.wrapperHeight\t= this.wrapper.clientHeight;\n\n\t\tvar rect = utils.getRect(this.scroller);\n/* REPLACE START: refresh */\n\n\t\tthis.scrollerWidth\t= rect.width;\n\t\tthis.scrollerHeight\t= rect.height;\n\n\t\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\t\tthis.maxScrollY\t\t= this.wrapperHeight - this.scrollerHeight;\n\n/* REPLACE END: refresh */\n\n\t\tthis.hasHorizontalScroll\t= this.options.scrollX && this.maxScrollX < 0;\n\t\tthis.hasVerticalScroll\t\t= this.options.scrollY && this.maxScrollY < 0;\n\t\t\n\t\tif ( !this.hasHorizontalScroll ) {\n\t\t\tthis.maxScrollX = 0;\n\t\t\tthis.scrollerWidth = this.wrapperWidth;\n\t\t}\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\tthis.maxScrollY = 0;\n\t\t\tthis.scrollerHeight = this.wrapperHeight;\n\t\t}\n\n\t\tthis.endTime = 0;\n\t\tthis.directionX = 0;\n\t\tthis.directionY = 0;\n\t\t\n\t\tif(utils.hasPointer && !this.options.disablePointer) {\n\t\t\t// The wrapper should have `touchAction` property for using pointerEvent.\n\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, true);\n\n\t\t\t// case. not support 'pinch-zoom'\n\t\t\t// https://github.com/cubiq/iscroll/issues/1118#issuecomment-270057583\n\t\t\tif (!this.wrapper.style[utils.style.touchAction]) {\n\t\t\t\tthis.wrapper.style[utils.style.touchAction] = utils.getTouchAction(this.options.eventPassthrough, false);\n\t\t\t}\n\t\t}\n\t\tthis.wrapperOffset = utils.offset(this.wrapper);\n\n\t\tthis._execEvent('refresh');\n\n\t\tthis.resetPosition();\n\n// INSERT POINT: _refresh\n\n\t},\t\n\n\ton: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\tthis._events[type] = [];\n\t\t}\n\n\t\tthis._events[type].push(fn);\n\t},\n\n\toff: function (type, fn) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar index = this._events[type].indexOf(fn);\n\n\t\tif ( index > -1 ) {\n\t\t\tthis._events[type].splice(index, 1);\n\t\t}\n\t},\n\n\t_execEvent: function (type) {\n\t\tif ( !this._events[type] ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this._events[type].length;\n\n\t\tif ( !l ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tthis._events[type][i].apply(this, [].slice.call(arguments, 1));\n\t\t}\n\t},\n\n\tscrollBy: function (x, y, time, easing) {\n\t\tx = this.x + x;\n\t\ty = this.y + y;\n\t\ttime = time || 0;\n\n\t\tthis.scrollTo(x, y, time, easing);\n\t},\n\n\tscrollTo: function (x, y, time, easing) {\n\t\teasing = easing || utils.ease.circular;\n\n\t\tthis.isInTransition = this.options.useTransition && time > 0;\n\t\tvar transitionType = this.options.useTransition && easing.style;\n\t\tif ( !time || transitionType ) {\n\t\t\t\tif(transitionType) {\n\t\t\t\t\tthis._transitionTimingFunction(easing.style);\n\t\t\t\t\tthis._transitionTime(time);\n\t\t\t\t}\n\t\t\tthis._translate(x, y);\n\t\t} else {\n\t\t\tthis._animate(x, y, time, easing.fn);\n\t\t}\n\t},\n\n\tscrollToElement: function (el, time, offsetX, offsetY, easing) {\n\t\tel = el.nodeType ? el : this.scroller.querySelector(el);\n\n\t\tif ( !el ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar pos = utils.offset(el);\n\n\t\tpos.left -= this.wrapperOffset.left;\n\t\tpos.top  -= this.wrapperOffset.top;\n\n\t\t// if offsetX/Y are true we center the element to the screen\n\t\tvar elRect = utils.getRect(el);\n\t\tvar wrapperRect = utils.getRect(this.wrapper);\n\t\tif ( offsetX === true ) {\n\t\t\toffsetX = Math.round(elRect.width / 2 - wrapperRect.width / 2);\n\t\t}\n\t\tif ( offsetY === true ) {\n\t\t\toffsetY = Math.round(elRect.height / 2 - wrapperRect.height / 2);\n\t\t}\n\n\t\tpos.left -= offsetX || 0;\n\t\tpos.top  -= offsetY || 0;\n\n\t\tpos.left = pos.left > 0 ? 0 : pos.left < this.maxScrollX ? this.maxScrollX : pos.left;\n\t\tpos.top  = pos.top  > 0 ? 0 : pos.top  < this.maxScrollY ? this.maxScrollY : pos.top;\n\n\t\ttime = time === undefined || time === null || time === 'auto' ? Math.max(Math.abs(this.x-pos.left), Math.abs(this.y-pos.top)) : time;\n\n\t\tthis.scrollTo(pos.left, pos.top, time, easing);\n\t},\n\n\t_transitionTime: function (time) {\n\t\tif (!this.options.useTransition) {\n\t\t\treturn;\n\t\t}\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.scrollerStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.scrollerStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.scrollerStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.scrollerStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n// INSERT POINT: _transitionTime\n\n\t},\n\n\t_transitionTimingFunction: function (easing) {\n\t\tthis.scrollerStyle[utils.style.transitionTimingFunction] = easing;\n\n// INSERT POINT: _transitionTimingFunction\n\n\t},\n\n\t_translate: function (x, y) {\n\t\tif ( this.options.useTransform ) {\n\n/* REPLACE START: _translate */\n\n\t\t\tthis.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.translateZ;\n\n/* REPLACE END: _translate */\n\n\t\t} else {\n\t\t\tx = Math.round(x);\n\t\t\ty = Math.round(y);\n\t\t\tthis.scrollerStyle.left = x + 'px';\n\t\t\tthis.scrollerStyle.top = y + 'px';\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n// INSERT POINT: _translate\n\n\t},\n\n\t_initEvents: function (remove) {\n\t\tvar eventType = remove ? utils.removeEvent : utils.addEvent,\n\t\t\ttarget = this.options.bindToWrapper ? this.wrapper : window;\n\n\t\teventType(window, 'orientationchange', this);\n\t\teventType(window, 'resize', this);\n\n\t\tif ( this.options.click ) {\n\t\t\teventType(this.wrapper, 'click', this, true);\n\t\t}\n\n\t\tif ( !this.options.disableMouse ) {\n\t\t\teventType(this.wrapper, 'mousedown', this);\n\t\t\teventType(target, 'mousemove', this);\n\t\t\teventType(target, 'mousecancel', this);\n\t\t\teventType(target, 'mouseup', this);\n\t\t}\n\n\t\tif ( utils.hasPointer && !this.options.disablePointer ) {\n\t\t\teventType(this.wrapper, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointermove'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointercancel'), this);\n\t\t\teventType(target, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\n\t\tif ( utils.hasTouch && !this.options.disableTouch ) {\n\t\t\teventType(this.wrapper, 'touchstart', this);\n\t\t\teventType(target, 'touchmove', this);\n\t\t\teventType(target, 'touchcancel', this);\n\t\t\teventType(target, 'touchend', this);\n\t\t}\n\n\t\teventType(this.scroller, 'transitionend', this);\n\t\teventType(this.scroller, 'webkitTransitionEnd', this);\n\t\teventType(this.scroller, 'oTransitionEnd', this);\n\t\teventType(this.scroller, 'MSTransitionEnd', this);\n\t},\n\n\tgetComputedPosition: function () {\n\t\tvar matrix = window.getComputedStyle(this.scroller, null),\n\t\t\tx, y;\n\n\t\tif ( this.options.useTransform ) {\n\t\t\tmatrix = matrix[utils.style.transform].split(')')[0].split(', ');\n\t\t\tx = +(matrix[12] || matrix[4]);\n\t\t\ty = +(matrix[13] || matrix[5]);\n\t\t} else {\n\t\t\tx = +matrix.left.replace(/[^-\\d.]/g, '');\n\t\t\ty = +matrix.top.replace(/[^-\\d.]/g, '');\n\t\t}\n\n\t\treturn { x: x, y: y };\n\t},"
  },
  {
    "path": "src/default/_animate.js",
    "content": "\n\t_animate: function (destX, destY, duration, easingFn) {\n\t\tvar that = this,\n\t\t\tstartX = this.x,\n\t\t\tstartY = this.y,\n\t\t\tstartTime = utils.getTime(),\n\t\t\tdestTime = startTime + duration;\n\n\t\tfunction step () {\n\t\t\tvar now = utils.getTime(),\n\t\t\t\tnewX, newY,\n\t\t\t\teasing;\n\n\t\t\tif ( now >= destTime ) {\n\t\t\t\tthat.isAnimating = false;\n\t\t\t\tthat._translate(destX, destY);\n\n\t\t\t\tif ( !that.resetPosition(that.options.bounceTime) ) {\n\t\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnow = ( now - startTime ) / duration;\n\t\t\teasing = easingFn(now);\n\t\t\tnewX = ( destX - startX ) * easing + startX;\n\t\t\tnewY = ( destY - startY ) * easing + startY;\n\t\t\tthat._translate(newX, newY);\n\n\t\t\tif ( that.isAnimating ) {\n\t\t\t\trAF(step);\n\t\t\t}\n\t\t}\n\n\t\tthis.isAnimating = true;\n\t\tstep();\n\t},"
  },
  {
    "path": "src/default/handleEvent.js",
    "content": "\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t\tcase 'orientationchange':\n\t\t\tcase 'resize':\n\t\t\t\tthis._resize();\n\t\t\t\tbreak;\n\t\t\tcase 'transitionend':\n\t\t\tcase 'webkitTransitionEnd':\n\t\t\tcase 'oTransitionEnd':\n\t\t\tcase 'MSTransitionEnd':\n\t\t\t\tthis._transitionEnd(e);\n\t\t\t\tbreak;\n\t\t\tcase 'wheel':\n\t\t\tcase 'DOMMouseScroll':\n\t\t\tcase 'mousewheel':\n\t\t\t\tthis._wheel(e);\n\t\t\t\tbreak;\n\t\t\tcase 'keydown':\n\t\t\t\tthis._key(e);\n\t\t\t\tbreak;\n\t\t\tcase 'click':\n\t\t\t\tif ( this.enabled && !e._constructed ) {\n\t\t\t\t\te.preventDefault();\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n};"
  },
  {
    "path": "src/indicator/_initIndicators.js",
    "content": "\n\t_initIndicators: function () {\n\t\tvar interactive = this.options.interactiveScrollbars,\n\t\t\tcustomStyle = typeof this.options.scrollbars != 'string',\n\t\t\tindicators = [],\n\t\t\tindicator;\n\n\t\tvar that = this;\n\n\t\tthis.indicators = [];\n\n\t\tif ( this.options.scrollbars ) {\n\t\t\t// Vertical scrollbar\n\t\t\tif ( this.options.scrollY ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('v', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenX: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\n\t\t\t// Horizontal scrollbar\n\t\t\tif ( this.options.scrollX ) {\n\t\t\t\tindicator = {\n\t\t\t\t\tel: createDefaultScrollbar('h', interactive, this.options.scrollbars),\n\t\t\t\t\tinteractive: interactive,\n\t\t\t\t\tdefaultScrollbars: true,\n\t\t\t\t\tcustomStyle: customStyle,\n\t\t\t\t\tresize: this.options.resizeScrollbars,\n\t\t\t\t\tshrink: this.options.shrinkScrollbars,\n\t\t\t\t\tfade: this.options.fadeScrollbars,\n\t\t\t\t\tlistenY: false\n\t\t\t\t};\n\n\t\t\t\tthis.wrapper.appendChild(indicator.el);\n\t\t\t\tindicators.push(indicator);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.indicators ) {\n\t\t\t// TODO: check concat compatibility\n\t\t\tindicators = indicators.concat(this.options.indicators);\n\t\t}\n\n\t\tfor ( var i = indicators.length; i--; ) {\n\t\t\tthis.indicators.push( new Indicator(this, indicators[i]) );\n\t\t}\n\n\t\t// TODO: check if we can use array.map (wide compatibility and performance issues)\n\t\tfunction _indicatorsMap (fn) {\n\t\t\tif (that.indicators) {\n\t\t\t\tfor ( var i = that.indicators.length; i--; ) {\n\t\t\t\t\tfn.call(that.indicators[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tthis.on('scrollEnd', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollCancel', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade();\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('scrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tthis.on('beforeScrollStart', function () {\n\t\t\t\t_indicatorsMap(function () {\n\t\t\t\t\tthis.fade(1, true);\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\n\t\tthis.on('refresh', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.refresh();\n\t\t\t});\n\t\t});\n\n\t\tthis.on('destroy', function () {\n\t\t\t_indicatorsMap(function () {\n\t\t\t\tthis.destroy();\n\t\t\t});\n\n\t\t\tdelete this.indicators;\n\t\t});\n\t},\n"
  },
  {
    "path": "src/indicator/_transitionTime.js",
    "content": "\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTime(time);\n\t\t\t}\n\t\t}\n"
  },
  {
    "path": "src/indicator/_transitionTimingFunction.js",
    "content": "\n\t\tif ( this.indicators ) {\n\t\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\t\tthis.indicators[i].transitionTimingFunction(easing);\n\t\t\t}\n\t\t}\n"
  },
  {
    "path": "src/indicator/_translate.js",
    "content": "\n\tif ( this.indicators ) {\n\t\tfor ( var i = this.indicators.length; i--; ) {\n\t\t\tthis.indicators[i].updatePosition();\n\t\t}\n\t}\n"
  },
  {
    "path": "src/indicator/build.json",
    "content": "{\n\t\"insert\": {\n\t\t\"OPTIONS\": \"\\t\\tresizeScrollbars: true,\",\n\t\t\"NORMALIZATION\": \"\\tif ( this.options.shrinkScrollbars == 'scale' ) {\\n\\t\\tthis.options.useTransition = false;\\n\\t}\",\n\t\t\"_init\": \"\\t\\tif ( this.options.scrollbars || this.options.indicators ) {\\n\\t\\t\\tthis._initIndicators();\\n\\t\\t}\",\n\t\t\"_transitionTime\": \"indicator/_transitionTime.js\",\n\t\t\"_transitionTimingFunction\": \"indicator/_transitionTimingFunction.js\",\n\t\t\"_translate\": \"indicator/_translate.js\"\n\t}\n}"
  },
  {
    "path": "src/indicator/indicator.js",
    "content": "\nfunction createDefaultScrollbar (direction, interactive, type) {\n\tvar scrollbar = document.createElement('div'),\n\t\tindicator = document.createElement('div');\n\n\tif ( type === true ) {\n\t\tscrollbar.style.cssText = 'position:absolute;z-index:9999';\n\t\tindicator.style.cssText = '-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;position:absolute;background:rgba(0,0,0,0.5);border:1px solid rgba(255,255,255,0.9);border-radius:3px';\n\t}\n\n\tindicator.className = 'iScrollIndicator';\n\n\tif ( direction == 'h' ) {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';height:7px;left:2px;right:2px;bottom:0';\n\t\t\tindicator.style.height = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollHorizontalScrollbar';\n\t} else {\n\t\tif ( type === true ) {\n\t\t\tscrollbar.style.cssText += ';width:7px;bottom:2px;top:2px;right:1px';\n\t\t\tindicator.style.width = '100%';\n\t\t}\n\t\tscrollbar.className = 'iScrollVerticalScrollbar';\n\t}\n\n\tscrollbar.style.cssText += ';overflow:hidden';\n\n\tif ( !interactive ) {\n\t\tscrollbar.style.pointerEvents = 'none';\n\t}\n\n\tscrollbar.appendChild(indicator);\n\n\treturn scrollbar;\n}\n\nfunction Indicator (scroller, options) {\n\tthis.wrapper = typeof options.el == 'string' ? document.querySelector(options.el) : options.el;\n\tthis.wrapperStyle = this.wrapper.style;\n\tthis.indicator = this.wrapper.children[0];\n\tthis.indicatorStyle = this.indicator.style;\n\tthis.scroller = scroller;\n\n\tthis.options = {\n\t\tlistenX: true,\n\t\tlistenY: true,\n\t\tinteractive: false,\n\t\tresize: true,\n\t\tdefaultScrollbars: false,\n\t\tshrink: false,\n\t\tfade: false,\n\t\tspeedRatioX: 0,\n\t\tspeedRatioY: 0\n\t};\n\n\tfor ( var i in options ) {\n\t\tthis.options[i] = options[i];\n\t}\n\n\tthis.sizeRatioX = 1;\n\tthis.sizeRatioY = 1;\n\tthis.maxPosX = 0;\n\tthis.maxPosY = 0;\n\n\tif ( this.options.interactive ) {\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.addEvent(window, 'touchend', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(this.indicator, 'mousedown', this);\n\t\t\tutils.addEvent(window, 'mouseup', this);\n\t\t}\n\t}\n\n\tif ( this.options.fade ) {\n\t\tthis.wrapperStyle[utils.style.transform] = this.scroller.translateZ;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\t\tthis.wrapperStyle[durationProp] = utils.isBadAndroid ? '0.0001ms' : '0ms';\n\t\t// remove 0.0001ms\n\t\tvar self = this;\n\t\tif(utils.isBadAndroid) {\n\t\t\trAF(function() {\n\t\t\t\tif(self.wrapperStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.wrapperStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tthis.wrapperStyle.opacity = '0';\n\t}\n}\n\nIndicator.prototype = {\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t}\n\t},\n\n\tdestroy: function () {\n\t\tif ( this.options.fadeScrollbars ) {\n\t\t\tclearTimeout(this.fadeTimeout);\n\t\t\tthis.fadeTimeout = null;\n\t\t}\n\t\tif ( this.options.interactive ) {\n\t\t\tutils.removeEvent(this.indicator, 'touchstart', this);\n\t\t\tutils.removeEvent(this.indicator, utils.prefixPointerEvent('pointerdown'), this);\n\t\t\tutils.removeEvent(this.indicator, 'mousedown', this);\n\n\t\t\tutils.removeEvent(window, 'touchmove', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\t\tutils.removeEvent(window, 'touchend', this);\n\t\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointerup'), this);\n\t\t\tutils.removeEvent(window, 'mouseup', this);\n\t\t}\n\n\t\tif ( this.options.defaultScrollbars && this.wrapper.parentNode ) {\n\t\t\tthis.wrapper.parentNode.removeChild(this.wrapper);\n\t\t}\n\t},\n\n\t_start: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tthis.transitionTime();\n\n\t\tthis.initiated = true;\n\t\tthis.moved = false;\n\t\tthis.lastPointX\t= point.pageX;\n\t\tthis.lastPointY\t= point.pageY;\n\n\t\tthis.startTime\t= utils.getTime();\n\n\t\tif ( !this.options.disableTouch ) {\n\t\t\tutils.addEvent(window, 'touchmove', this);\n\t\t}\n\t\tif ( !this.options.disablePointer ) {\n\t\t\tutils.addEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\t}\n\t\tif ( !this.options.disableMouse ) {\n\t\t\tutils.addEvent(window, 'mousemove', this);\n\t\t}\n\n\t\tthis.scroller._execEvent('beforeScrollStart');\n\t},\n\n\t_move: function (e) {\n\t\tvar point = e.touches ? e.touches[0] : e,\n\t\t\tdeltaX, deltaY,\n\t\t\tnewX, newY,\n\t\t\ttimestamp = utils.getTime();\n\n\t\tif ( !this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollStart');\n\t\t}\n\n\t\tthis.moved = true;\n\n\t\tdeltaX = point.pageX - this.lastPointX;\n\t\tthis.lastPointX = point.pageX;\n\n\t\tdeltaY = point.pageY - this.lastPointY;\n\t\tthis.lastPointY = point.pageY;\n\n\t\tnewX = this.x + deltaX;\n\t\tnewY = this.y + deltaY;\n\n\t\tthis._pos(newX, newY);\n\n// INSERT POINT: indicator._move\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\t},\n\n\t_end: function (e) {\n\t\tif ( !this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.initiated = false;\n\n\t\te.preventDefault();\n\t\te.stopPropagation();\n\n\t\tutils.removeEvent(window, 'touchmove', this);\n\t\tutils.removeEvent(window, utils.prefixPointerEvent('pointermove'), this);\n\t\tutils.removeEvent(window, 'mousemove', this);\n\n\t\tif ( this.scroller.options.snap ) {\n\t\t\tvar snap = this.scroller._nearestSnap(this.scroller.x, this.scroller.y);\n\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.x - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.scroller.y - snap.y), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tif ( this.scroller.x != snap.x || this.scroller.y != snap.y ) {\n\t\t\t\tthis.scroller.directionX = 0;\n\t\t\t\tthis.scroller.directionY = 0;\n\t\t\t\tthis.scroller.currentPage = snap;\n\t\t\t\tthis.scroller.scrollTo(snap.x, snap.y, time, this.scroller.options.bounceEasing);\n\t\t\t}\n\t\t}\n\n\t\tif ( this.moved ) {\n\t\t\tthis.scroller._execEvent('scrollEnd');\n\t\t}\n\t},\n\n\ttransitionTime: function (time) {\n\t\ttime = time || 0;\n\t\tvar durationProp = utils.style.transitionDuration;\n\t\tif(!durationProp) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.indicatorStyle[durationProp] = time + 'ms';\n\n\t\tif ( !time && utils.isBadAndroid ) {\n\t\t\tthis.indicatorStyle[durationProp] = '0.0001ms';\n\t\t\t// remove 0.0001ms\n\t\t\tvar self = this;\n\t\t\trAF(function() {\n\t\t\t\tif(self.indicatorStyle[durationProp] === '0.0001ms') {\n\t\t\t\t\tself.indicatorStyle[durationProp] = '0s';\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t},\n\n\ttransitionTimingFunction: function (easing) {\n\t\tthis.indicatorStyle[utils.style.transitionTimingFunction] = easing;\n\t},\n\n\trefresh: function () {\n\t\tthis.transitionTime();\n\n\t\tif ( this.options.listenX && !this.options.listenY ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll ? 'block' : 'none';\n\t\t} else if ( this.options.listenY && !this.options.listenX ) {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t} else {\n\t\t\tthis.indicatorStyle.display = this.scroller.hasHorizontalScroll || this.scroller.hasVerticalScroll ? 'block' : 'none';\n\t\t}\n\n\t\tif ( this.scroller.hasHorizontalScroll && this.scroller.hasVerticalScroll ) {\n\t\t\tutils.addClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.removeClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '8px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '8px';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tutils.removeClass(this.wrapper, 'iScrollBothScrollbars');\n\t\t\tutils.addClass(this.wrapper, 'iScrollLoneScrollbar');\n\n\t\t\tif ( this.options.defaultScrollbars && this.options.customStyle ) {\n\t\t\t\tif ( this.options.listenX ) {\n\t\t\t\t\tthis.wrapper.style.right = '2px';\n\t\t\t\t} else {\n\t\t\t\t\tthis.wrapper.style.bottom = '2px';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tutils.getRect(this.wrapper);\t// force refresh\n\n\t\tif ( this.options.listenX ) {\n\t\t\tthis.wrapperWidth = this.wrapper.clientWidth;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorWidth = Math.max(Math.round(this.wrapperWidth * this.wrapperWidth / (this.scroller.scrollerWidth || this.wrapperWidth || 1)), 8);\n\t\t\t\tthis.indicatorStyle.width = this.indicatorWidth + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorWidth = this.indicator.clientWidth;\n\t\t\t}\n\n\t\t\tthis.maxPosX = this.wrapperWidth - this.indicatorWidth;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryX = -this.indicatorWidth + 8;\n\t\t\t\tthis.maxBoundaryX = this.wrapperWidth - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryX = 0;\n\t\t\t\tthis.maxBoundaryX = this.maxPosX;\n\t\t\t}\n\n\t\t\tthis.sizeRatioX = this.options.speedRatioX || (this.scroller.maxScrollX && (this.maxPosX / this.scroller.maxScrollX));\n\t\t}\n\n\t\tif ( this.options.listenY ) {\n\t\t\tthis.wrapperHeight = this.wrapper.clientHeight;\n\t\t\tif ( this.options.resize ) {\n\t\t\t\tthis.indicatorHeight = Math.max(Math.round(this.wrapperHeight * this.wrapperHeight / (this.scroller.scrollerHeight || this.wrapperHeight || 1)), 8);\n\t\t\t\tthis.indicatorStyle.height = this.indicatorHeight + 'px';\n\t\t\t} else {\n\t\t\t\tthis.indicatorHeight = this.indicator.clientHeight;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\n\t\t\tif ( this.options.shrink == 'clip' ) {\n\t\t\t\tthis.minBoundaryY = -this.indicatorHeight + 8;\n\t\t\t\tthis.maxBoundaryY = this.wrapperHeight - 8;\n\t\t\t} else {\n\t\t\t\tthis.minBoundaryY = 0;\n\t\t\t\tthis.maxBoundaryY = this.maxPosY;\n\t\t\t}\n\n\t\t\tthis.maxPosY = this.wrapperHeight - this.indicatorHeight;\n\t\t\tthis.sizeRatioY = this.options.speedRatioY || (this.scroller.maxScrollY && (this.maxPosY / this.scroller.maxScrollY));\n\t\t}\n\n\t\tthis.updatePosition();\n\t},\n\n\tupdatePosition: function () {\n\t\tvar x = this.options.listenX && Math.round(this.sizeRatioX * this.scroller.x) || 0,\n\t\t\ty = this.options.listenY && Math.round(this.sizeRatioY * this.scroller.y) || 0;\n\n\t\tif ( !this.options.ignoreBoundaries ) {\n\t\t\tif ( x < this.minBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth + x, 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t}\n\t\t\t\tx = this.minBoundaryX;\n\t\t\t} else if ( x > this.maxBoundaryX ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.width = Math.max(this.indicatorWidth - (x - this.maxPosX), 8);\n\t\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t\t\tx = this.maxPosX + this.indicatorWidth - this.width;\n\t\t\t\t} else {\n\t\t\t\t\tx = this.maxBoundaryX;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.width != this.indicatorWidth ) {\n\t\t\t\tthis.width = this.indicatorWidth;\n\t\t\t\tthis.indicatorStyle.width = this.width + 'px';\n\t\t\t}\n\n\t\t\tif ( y < this.minBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight + y * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t}\n\t\t\t\ty = this.minBoundaryY;\n\t\t\t} else if ( y > this.maxBoundaryY ) {\n\t\t\t\tif ( this.options.shrink == 'scale' ) {\n\t\t\t\t\tthis.height = Math.max(this.indicatorHeight - (y - this.maxPosY) * 3, 8);\n\t\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t\t\ty = this.maxPosY + this.indicatorHeight - this.height;\n\t\t\t\t} else {\n\t\t\t\t\ty = this.maxBoundaryY;\n\t\t\t\t}\n\t\t\t} else if ( this.options.shrink == 'scale' && this.height != this.indicatorHeight ) {\n\t\t\t\tthis.height = this.indicatorHeight;\n\t\t\t\tthis.indicatorStyle.height = this.height + 'px';\n\t\t\t}\n\t\t}\n\n\t\tthis.x = x;\n\t\tthis.y = y;\n\n\t\tif ( this.scroller.options.useTransform ) {\n\t\t\tthis.indicatorStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px)' + this.scroller.translateZ;\n\t\t} else {\n\t\t\tthis.indicatorStyle.left = x + 'px';\n\t\t\tthis.indicatorStyle.top = y + 'px';\n\t\t}\n\t},\n\n\t_pos: function (x, y) {\n\t\tif ( x < 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x > this.maxPosX ) {\n\t\t\tx = this.maxPosX;\n\t\t}\n\n\t\tif ( y < 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y > this.maxPosY ) {\n\t\t\ty = this.maxPosY;\n\t\t}\n\n\t\tx = this.options.listenX ? Math.round(x / this.sizeRatioX) : this.scroller.x;\n\t\ty = this.options.listenY ? Math.round(y / this.sizeRatioY) : this.scroller.y;\n\n\t\tthis.scroller.scrollTo(x, y);\n\t},\n\n\tfade: function (val, hold) {\n\t\tif ( hold && !this.visible ) {\n\t\t\treturn;\n\t\t}\n\n\t\tclearTimeout(this.fadeTimeout);\n\t\tthis.fadeTimeout = null;\n\n\t\tvar time = val ? 250 : 500,\n\t\t\tdelay = val ? 0 : 300;\n\n\t\tval = val ? '1' : '0';\n\n\t\tthis.wrapperStyle[utils.style.transitionDuration] = time + 'ms';\n\n\t\tthis.fadeTimeout = setTimeout((function (val) {\n\t\t\tthis.wrapperStyle.opacity = val;\n\t\t\tthis.visible = +val;\n\t\t}).bind(this, val), delay);\n\t}\n};\n"
  },
  {
    "path": "src/infinite/build.json",
    "content": "{\n\t\"insert\": {\n\t\t\"OPTIONS\": \"\\t\\tinfiniteUseTransform: true,\\n\\t\\tdeceleration: 0.004,\",\n\t\t\"NORMALIZATION\": \"\\tif ( this.options.infiniteElements ) {\\n\\t\\tthis.options.probeType = 3;\\n\\t}\\n\\tthis.options.infiniteUseTransform = this.options.infiniteUseTransform && this.options.useTransform;\",\n\t\t\"_init\": \"\\t\\tif ( this.options.infiniteElements ) {\\n\\t\\t\\tthis._initInfinite();\\n\\t\\t}\"\n\t},\n\t\"replace\": {\n\t\t\"refresh\": \"infinite/refresh.js\"\n\t}\n}"
  },
  {
    "path": "src/infinite/infinite.js",
    "content": "\n\t_initInfinite: function () {\n\t\tvar el = this.options.infiniteElements;\n\n\t\tthis.infiniteElements = typeof el == 'string' ? document.querySelectorAll(el) : el;\n\t\tthis.infiniteLength = this.infiniteElements.length;\n\t\tthis.infiniteMaster = this.infiniteElements[0];\n\t\tthis.infiniteElementHeight = utils.getRect(this.infiniteMaster).height;\n\t\tthis.infiniteHeight = this.infiniteLength * this.infiniteElementHeight;\n\n\t\tthis.options.cacheSize = this.options.cacheSize || 1000;\n\t\tthis.infiniteCacheBuffer = Math.round(this.options.cacheSize / 4);\n\n\t\t//this.infiniteCache = {};\n\t\tthis.options.dataset.call(this, 0, this.options.cacheSize);\n\n\t\tthis.on('refresh', function () {\n\t\t\tvar elementsPerPage = Math.ceil(this.wrapperHeight / this.infiniteElementHeight);\n\t\t\tthis.infiniteUpperBufferSize = Math.floor((this.infiniteLength - elementsPerPage) / 2);\n\t\t\tthis.reorderInfinite();\n\t\t});\n\n\t\tthis.on('scroll', this.reorderInfinite);\n\t},\n\n\t// TO-DO: clean up the mess\n\treorderInfinite: function () {\n\t\tvar center = -this.y + this.wrapperHeight / 2;\n\n\t\tvar minorPhase = Math.max(Math.floor(-this.y / this.infiniteElementHeight) - this.infiniteUpperBufferSize, 0),\n\t\t\tmajorPhase = Math.floor(minorPhase / this.infiniteLength),\n\t\t\tphase = minorPhase - majorPhase * this.infiniteLength;\n\n\t\tvar top = 0;\n\t\tvar i = 0;\n\t\tvar update = [];\n\n\t\t//var cachePhase = Math.floor((minorPhase + this.infiniteLength / 2) / this.infiniteCacheBuffer);\n\t\tvar cachePhase = Math.floor(minorPhase / this.infiniteCacheBuffer);\n\n\t\twhile ( i < this.infiniteLength ) {\n\t\t\ttop = i * this.infiniteElementHeight + majorPhase * this.infiniteHeight;\n\n\t\t\tif ( phase > i ) {\n\t\t\t\ttop += this.infiniteElementHeight * this.infiniteLength;\n\t\t\t}\n\n\t\t\tif ( this.infiniteElements[i]._top !== top ) {\n\t\t\t\tthis.infiniteElements[i]._phase = top / this.infiniteElementHeight;\n\n\t\t\t\tif ( this.infiniteElements[i]._phase < this.options.infiniteLimit ) {\n\t\t\t\t\tthis.infiniteElements[i]._top = top;\n\t\t\t\t\tif ( this.options.infiniteUseTransform ) {\n\t\t\t\t\t\tthis.infiniteElements[i].style[utils.style.transform] = 'translate(0, ' + top + 'px)' + this.translateZ;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.infiniteElements[i].style.top = top + 'px';\n\t\t\t\t\t}\n\t\t\t\t\tupdate.push(this.infiniteElements[i]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\ti++;\n\t\t}\n\n\t\tif ( this.cachePhase != cachePhase && (cachePhase === 0 || minorPhase - this.infiniteCacheBuffer > 0) ) {\n\t\t\tthis.options.dataset.call(this, Math.max(cachePhase * this.infiniteCacheBuffer - this.infiniteCacheBuffer, 0), this.options.cacheSize);\n\t\t}\n\n\t\tthis.cachePhase = cachePhase;\n\n\t\tthis.updateContent(update);\n\t},\n\n\tupdateContent: function (els) {\n\t\tif ( this.infiniteCache === undefined ) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor ( var i = 0, l = els.length; i < l; i++ ) {\n\t\t\tthis.options.dataFiller.call(this, els[i], this.infiniteCache[els[i]._phase]);\n\t\t}\n\t},\n\n\tupdateCache: function (start, data) {\n\t\tvar firstRun = this.infiniteCache === undefined;\n\n\t\tthis.infiniteCache = {};\n\n\t\tfor ( var i = 0, l = data.length; i < l; i++ ) {\n\t\t\tthis.infiniteCache[start++] = data[i];\n\t\t}\n\n\t\tif ( firstRun ) {\n\t\t\tthis.updateContent(this.infiniteElements);\n\t\t}\n\n\t},\n\n"
  },
  {
    "path": "src/infinite/refresh.js",
    "content": "\n\t\tthis.scrollerWidth\t= rect.width;\n\t\tthis.scrollerHeight\t= rect.height;\n\n\t\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\n\t\tvar limit;\n\t\tif ( this.options.infiniteElements ) {\n\t\t\tthis.options.infiniteLimit = this.options.infiniteLimit || Math.floor(2147483645 / this.infiniteElementHeight);\n\t\t\tlimit = -this.options.infiniteLimit * this.infiniteElementHeight + this.wrapperHeight;\n\t\t}\n\t\tthis.maxScrollY\t\t= limit !== undefined ? limit : this.wrapperHeight - this.scrollerHeight;\n"
  },
  {
    "path": "src/keys/build.json",
    "content": "{\n\t\"insert\": {\n\t\t\"_init\": \"\\t\\tif ( this.options.keyBindings ) {\\n\\t\\t\\tthis._initKeys();\\n\\t\\t}\"\n\t}\n}"
  },
  {
    "path": "src/keys/keys.js",
    "content": "\n\t_initKeys: function (e) {\n\t\t// default key bindings\n\t\tvar keys = {\n\t\t\tpageUp: 33,\n\t\t\tpageDown: 34,\n\t\t\tend: 35,\n\t\t\thome: 36,\n\t\t\tleft: 37,\n\t\t\tup: 38,\n\t\t\tright: 39,\n\t\t\tdown: 40\n\t\t};\n\t\tvar i;\n\n\t\t// if you give me characters I give you keycode\n\t\tif ( typeof this.options.keyBindings == 'object' ) {\n\t\t\tfor ( i in this.options.keyBindings ) {\n\t\t\t\tif ( typeof this.options.keyBindings[i] == 'string' ) {\n\t\t\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i].toUpperCase().charCodeAt(0);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.options.keyBindings = {};\n\t\t}\n\n\t\tfor ( i in keys ) {\n\t\t\tthis.options.keyBindings[i] = this.options.keyBindings[i] || keys[i];\n\t\t}\n\n\t\tutils.addEvent(window, 'keydown', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tutils.removeEvent(window, 'keydown', this);\n\t\t});\n\t},\n\n\t_key: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar snap = this.options.snap,\t// we are using this alot, better to cache it\n\t\t\tnewX = snap ? this.currentPage.pageX : this.x,\n\t\t\tnewY = snap ? this.currentPage.pageY : this.y,\n\t\t\tnow = utils.getTime(),\n\t\t\tprevTime = this.keyTime || 0,\n\t\t\tacceleration = 0.250,\n\t\t\tpos;\n\n\t\tif ( this.options.useTransition && this.isInTransition ) {\n\t\t\tpos = this.getComputedPosition();\n\n\t\t\tthis._translate(Math.round(pos.x), Math.round(pos.y));\n\t\t\tthis.isInTransition = false;\n\t\t}\n\n\t\tthis.keyAcceleration = now - prevTime < 200 ? Math.min(this.keyAcceleration + acceleration, 50) : 0;\n\n\t\tswitch ( e.keyCode ) {\n\t\t\tcase this.options.keyBindings.pageUp:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX += snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY += snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.pageDown:\n\t\t\t\tif ( this.hasHorizontalScroll && !this.hasVerticalScroll ) {\n\t\t\t\t\tnewX -= snap ? 1 : this.wrapperWidth;\n\t\t\t\t} else {\n\t\t\t\t\tnewY -= snap ? 1 : this.wrapperHeight;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.end:\n\t\t\t\tnewX = snap ? this.pages.length-1 : this.maxScrollX;\n\t\t\t\tnewY = snap ? this.pages[0].length-1 : this.maxScrollY;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.home:\n\t\t\t\tnewX = 0;\n\t\t\t\tnewY = 0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.left:\n\t\t\t\tnewX += snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.up:\n\t\t\t\tnewY += snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.right:\n\t\t\t\tnewX -= snap ? -1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tcase this.options.keyBindings.down:\n\t\t\t\tnewY -= snap ? 1 : 5 + this.keyAcceleration>>0;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn;\n\t\t}\n\n\t\tif ( snap ) {\n\t\t\tthis.goToPage(newX, newY);\n\t\t\treturn;\n\t\t}\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t\tthis.keyAcceleration = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t\tthis.keyAcceleration = 0;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n\t\tthis.keyTime = now;\n\t},\n"
  },
  {
    "path": "src/open.js",
    "content": "(function (window, document, Math) {\n"
  },
  {
    "path": "src/probe/_animate.js",
    "content": "\n\t_animate: function (destX, destY, duration, easingFn) {\n\t\tvar that = this,\n\t\t\tstartX = this.x,\n\t\t\tstartY = this.y,\n\t\t\tstartTime = utils.getTime(),\n\t\t\tdestTime = startTime + duration;\n\n\t\tfunction step () {\n\t\t\tvar now = utils.getTime(),\n\t\t\t\tnewX, newY,\n\t\t\t\teasing;\n\n\t\t\tif ( now >= destTime ) {\n\t\t\t\tthat.isAnimating = false;\n\t\t\t\tthat._translate(destX, destY);\n\t\t\t\t\n\t\t\t\tif ( !that.resetPosition(that.options.bounceTime) ) {\n\t\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tnow = ( now - startTime ) / duration;\n\t\t\teasing = easingFn(now);\n\t\t\tnewX = ( destX - startX ) * easing + startX;\n\t\t\tnewY = ( destY - startY ) * easing + startY;\n\t\t\tthat._translate(newX, newY);\n\n\t\t\tif ( that.isAnimating ) {\n\t\t\t\trAF(step);\n\t\t\t}\n\n\t\t\tif ( that.options.probeType == 3 ) {\n\t\t\t\tthat._execEvent('scroll');\n\t\t\t}\n\t\t}\n\n\t\tthis.isAnimating = true;\n\t\tstep();\n\t},\n"
  },
  {
    "path": "src/probe/_move.js",
    "content": "\n\t\tif ( timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.startX = this.x;\n\t\t\tthis.startY = this.y;\n\n\t\t\tif ( this.options.probeType == 1 ) {\n\t\t\t\tthis._execEvent('scroll');\n\t\t\t}\n\t\t}\n\n\t\tif ( this.options.probeType > 1 ) {\n\t\t\tthis._execEvent('scroll');\n\t\t}\n"
  },
  {
    "path": "src/probe/build.json",
    "content": "{\n\t\"insert\": {\n\t\t\"NORMALIZATION\": \"\\tif ( this.options.probeType == 3 ) {\\n\\t\\tthis.options.useTransition = false;\\t}\",\n\t\t\"_wheel\": \"\\t\\tif ( this.options.probeType > 1 ) {\\n\\t\\t\\tthis._execEvent('scroll');\\n\\t\\t}\",\n\t\t\"indicator._move\": \"probe/indicator._move.js\"\n\t},\n\t\"replace\": {\n\t\t\"_move\": \"probe/_move.js\"\n\t}\n}"
  },
  {
    "path": "src/probe/indicator._move.js",
    "content": "\n\t\tif ( this.scroller.options.probeType == 1 && timestamp - this.startTime > 300 ) {\n\t\t\tthis.startTime = timestamp;\n\t\t\tthis.scroller._execEvent('scroll');\n\t\t} else if ( this.scroller.options.probeType > 1 ) {\n\t\t\tthis.scroller._execEvent('scroll');\n\t\t}\n"
  },
  {
    "path": "src/probe/probe.js",
    "content": "\niScroll.prototype._initProbe = function () {\n\tif ( this.options.probeType == 3 ) {\n\t\tthis.options.useTransition = false;\n\t}\n};\n"
  },
  {
    "path": "src/snap/_end.js",
    "content": "\n\t\tif ( this.options.snap ) {\n\t\t\tvar snap = this._nearestSnap(newX, newY);\n\t\t\tthis.currentPage = snap;\n\t\t\ttime = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(newX - snap.x), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(newY - snap.y), 1000)\n\t\t\t\t\t), 300);\n\t\t\tnewX = snap.x;\n\t\t\tnewY = snap.y;\n\n\t\t\tthis.directionX = 0;\n\t\t\tthis.directionY = 0;\n\t\t\teasing = this.options.bounceEasing;\n\t\t}"
  },
  {
    "path": "src/snap/build.json",
    "content": "{\n\t\"insert\": {\n\t\t\"OPTIONS\": \"\\t\\tsnapThreshold: 0.334,\",\n\t\t\"_end\": \"snap/_end.js\",\n\t\t\"refresh\": \"snap/refresh.js\",\n\t\t\"_init\": \"\\t\\tif ( this.options.snap ) {\\n\\t\\t\\tthis._initSnap();\\n\\t\\t}\"\n\t}\n}"
  },
  {
    "path": "src/snap/refresh.js",
    "content": "\n\t\tif ( this.options.snap ) {\n\t\t\tvar snap = this._nearestSnap(this.x, this.y);\n\t\t\tif ( this.x == snap.x && this.y == snap.y ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis.currentPage = snap;\n\t\t\tthis.scrollTo(snap.x, snap.y);\n\t\t}\n"
  },
  {
    "path": "src/snap/snap.js",
    "content": "\n\t_initSnap: function () {\n\t\tthis.currentPage = {};\n\n\t\tif ( typeof this.options.snap == 'string' ) {\n\t\t\tthis.options.snap = this.scroller.querySelectorAll(this.options.snap);\n\t\t}\n\n\t\tthis.on('refresh', function () {\n\t\t\tvar i = 0, l,\n\t\t\t\tm = 0, n,\n\t\t\t\tcx, cy,\n\t\t\t\tx = 0, y,\n\t\t\t\tstepX = this.options.snapStepX || this.wrapperWidth,\n\t\t\t\tstepY = this.options.snapStepY || this.wrapperHeight,\n\t\t\t\tel,\n\t\t\t\trect;\n\n\t\t\tthis.pages = [];\n\n\t\t\tif ( !this.wrapperWidth || !this.wrapperHeight || !this.scrollerWidth || !this.scrollerHeight ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( this.options.snap === true ) {\n\t\t\t\tcx = Math.round( stepX / 2 );\n\t\t\t\tcy = Math.round( stepY / 2 );\n\n\t\t\t\twhile ( x > -this.scrollerWidth ) {\n\t\t\t\t\tthis.pages[i] = [];\n\t\t\t\t\tl = 0;\n\t\t\t\t\ty = 0;\n\n\t\t\t\t\twhile ( y > -this.scrollerHeight ) {\n\t\t\t\t\t\tthis.pages[i][l] = {\n\t\t\t\t\t\t\tx: Math.max(x, this.maxScrollX),\n\t\t\t\t\t\t\ty: Math.max(y, this.maxScrollY),\n\t\t\t\t\t\t\twidth: stepX,\n\t\t\t\t\t\t\theight: stepY,\n\t\t\t\t\t\t\tcx: x - cx,\n\t\t\t\t\t\t\tcy: y - cy\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\ty -= stepY;\n\t\t\t\t\t\tl++;\n\t\t\t\t\t}\n\n\t\t\t\t\tx -= stepX;\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tel = this.options.snap;\n\t\t\t\tl = el.length;\n\t\t\t\tn = -1;\n\n\t\t\t\tfor ( ; i < l; i++ ) {\n\t\t\t\t\trect = utils.getRect(el[i]);\n\t\t\t\t\tif ( i === 0 || rect.left <= utils.getRect(el[i-1]).left ) {\n\t\t\t\t\t\tm = 0;\n\t\t\t\t\t\tn++;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !this.pages[m] ) {\n\t\t\t\t\t\tthis.pages[m] = [];\n\t\t\t\t\t}\n\n\t\t\t\t\tx = Math.max(-rect.left, this.maxScrollX);\n\t\t\t\t\ty = Math.max(-rect.top, this.maxScrollY);\n\t\t\t\t\tcx = x - Math.round(rect.width / 2);\n\t\t\t\t\tcy = y - Math.round(rect.height / 2);\n\n\t\t\t\t\tthis.pages[m][n] = {\n\t\t\t\t\t\tx: x,\n\t\t\t\t\t\ty: y,\n\t\t\t\t\t\twidth: rect.width,\n\t\t\t\t\t\theight: rect.height,\n\t\t\t\t\t\tcx: cx,\n\t\t\t\t\t\tcy: cy\n\t\t\t\t\t};\n\n\t\t\t\t\tif ( x > this.maxScrollX ) {\n\t\t\t\t\t\tm++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.goToPage(this.currentPage.pageX || 0, this.currentPage.pageY || 0, 0);\n\n\t\t\t// Update snap threshold if needed\n\t\t\tif ( this.options.snapThreshold % 1 === 0 ) {\n\t\t\t\tthis.snapThresholdX = this.options.snapThreshold;\n\t\t\t\tthis.snapThresholdY = this.options.snapThreshold;\n\t\t\t} else {\n\t\t\t\tthis.snapThresholdX = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].width * this.options.snapThreshold);\n\t\t\t\tthis.snapThresholdY = Math.round(this.pages[this.currentPage.pageX][this.currentPage.pageY].height * this.options.snapThreshold);\n\t\t\t}\n\t\t});\n\n\t\tthis.on('flick', function () {\n\t\t\tvar time = this.options.snapSpeed || Math.max(\n\t\t\t\t\tMath.max(\n\t\t\t\t\t\tMath.min(Math.abs(this.x - this.startX), 1000),\n\t\t\t\t\t\tMath.min(Math.abs(this.y - this.startY), 1000)\n\t\t\t\t\t), 300);\n\n\t\t\tthis.goToPage(\n\t\t\t\tthis.currentPage.pageX + this.directionX,\n\t\t\t\tthis.currentPage.pageY + this.directionY,\n\t\t\t\ttime\n\t\t\t);\n\t\t});\n\t},\n\n\t_nearestSnap: function (x, y) {\n\t\tif ( !this.pages.length ) {\n\t\t\treturn { x: 0, y: 0, pageX: 0, pageY: 0 };\n\t\t}\n\n\t\tvar i = 0,\n\t\t\tl = this.pages.length,\n\t\t\tm = 0;\n\n\t\t// Check if we exceeded the snap threshold\n\t\tif ( Math.abs(x - this.absStartX) < this.snapThresholdX &&\n\t\t\tMath.abs(y - this.absStartY) < this.snapThresholdY ) {\n\t\t\treturn this.currentPage;\n\t\t}\n\n\t\tif ( x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\tif ( x >= this.pages[i][0].cx ) {\n\t\t\t\tx = this.pages[i][0].x;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tl = this.pages[i].length;\n\n\t\tfor ( ; m < l; m++ ) {\n\t\t\tif ( y >= this.pages[0][m].cy ) {\n\t\t\t\ty = this.pages[0][m].y;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif ( i == this.currentPage.pageX ) {\n\t\t\ti += this.directionX;\n\n\t\t\tif ( i < 0 ) {\n\t\t\t\ti = 0;\n\t\t\t} else if ( i >= this.pages.length ) {\n\t\t\t\ti = this.pages.length - 1;\n\t\t\t}\n\n\t\t\tx = this.pages[i][0].x;\n\t\t}\n\n\t\tif ( m == this.currentPage.pageY ) {\n\t\t\tm += this.directionY;\n\n\t\t\tif ( m < 0 ) {\n\t\t\t\tm = 0;\n\t\t\t} else if ( m >= this.pages[0].length ) {\n\t\t\t\tm = this.pages[0].length - 1;\n\t\t\t}\n\n\t\t\ty = this.pages[0][m].y;\n\t\t}\n\n\t\treturn {\n\t\t\tx: x,\n\t\t\ty: y,\n\t\t\tpageX: i,\n\t\t\tpageY: m\n\t\t};\n\t},\n\n\tgoToPage: function (x, y, time, easing) {\n\t\teasing = easing || this.options.bounceEasing;\n\n\t\tif ( x >= this.pages.length ) {\n\t\t\tx = this.pages.length - 1;\n\t\t} else if ( x < 0 ) {\n\t\t\tx = 0;\n\t\t}\n\n\t\tif ( y >= this.pages[x].length ) {\n\t\t\ty = this.pages[x].length - 1;\n\t\t} else if ( y < 0 ) {\n\t\t\ty = 0;\n\t\t}\n\n\t\tvar posX = this.pages[x][y].x,\n\t\t\tposY = this.pages[x][y].y;\n\n\t\ttime = time === undefined ? this.options.snapSpeed || Math.max(\n\t\t\tMath.max(\n\t\t\t\tMath.min(Math.abs(posX - this.x), 1000),\n\t\t\t\tMath.min(Math.abs(posY - this.y), 1000)\n\t\t\t), 300) : time;\n\n\t\tthis.currentPage = {\n\t\t\tx: posX,\n\t\t\ty: posY,\n\t\t\tpageX: x,\n\t\t\tpageY: y\n\t\t};\n\n\t\tthis.scrollTo(posX, posY, time, easing);\n\t},\n\n\tnext: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx++;\n\n\t\tif ( x >= this.pages.length && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty++;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n\n\tprev: function (time, easing) {\n\t\tvar x = this.currentPage.pageX,\n\t\t\ty = this.currentPage.pageY;\n\n\t\tx--;\n\n\t\tif ( x < 0 && this.hasVerticalScroll ) {\n\t\t\tx = 0;\n\t\t\ty--;\n\t\t}\n\n\t\tthis.goToPage(x, y, time, easing);\n\t},\n"
  },
  {
    "path": "src/utils.js",
    "content": "var rAF = window.requestAnimationFrame\t||\n\twindow.webkitRequestAnimationFrame\t||\n\twindow.mozRequestAnimationFrame\t\t||\n\twindow.oRequestAnimationFrame\t\t||\n\twindow.msRequestAnimationFrame\t\t||\n\tfunction (callback) { window.setTimeout(callback, 1000 / 60); };\n\nvar utils = (function () {\n\tvar me = {};\n\n\tvar _elementStyle = document.createElement('div').style;\n\tvar _vendor = (function () {\n\t\tvar vendors = ['t', 'webkitT', 'MozT', 'msT', 'OT'],\n\t\t\ttransform,\n\t\t\ti = 0,\n\t\t\tl = vendors.length;\n\n\t\tfor ( ; i < l; i++ ) {\n\t\t\ttransform = vendors[i] + 'ransform';\n\t\t\tif ( transform in _elementStyle ) return vendors[i].substr(0, vendors[i].length-1);\n\t\t}\n\n\t\treturn false;\n\t})();\n\n\tfunction _prefixStyle (style) {\n\t\tif ( _vendor === false ) return false;\n\t\tif ( _vendor === '' ) return style;\n\t\treturn _vendor + style.charAt(0).toUpperCase() + style.substr(1);\n\t}\n\n\tme.getTime = Date.now || function getTime () { return new Date().getTime(); };\n\n\tme.extend = function (target, obj) {\n\t\tfor ( var i in obj ) {\n\t\t\ttarget[i] = obj[i];\n\t\t}\n\t};\n\n\tme.addEvent = function (el, type, fn, capture) {\n\t\tel.addEventListener(type, fn, !!capture);\n\t};\n\n\tme.removeEvent = function (el, type, fn, capture) {\n\t\tel.removeEventListener(type, fn, !!capture);\n\t};\n\n\tme.prefixPointerEvent = function (pointerEvent) {\n\t\treturn window.MSPointerEvent ?\n\t\t\t'MSPointer' + pointerEvent.charAt(7).toUpperCase() + pointerEvent.substr(8):\n\t\t\tpointerEvent;\n\t};\n\n\tme.momentum = function (current, start, time, lowerMargin, wrapperSize, deceleration) {\n\t\tvar distance = current - start,\n\t\t\tspeed = Math.abs(distance) / time,\n\t\t\tdestination,\n\t\t\tduration;\n\n\t\tdeceleration = deceleration === undefined ? 0.0006 : deceleration;\n\n\t\tdestination = current + ( speed * speed ) / ( 2 * deceleration ) * ( distance < 0 ? -1 : 1 );\n\t\tduration = speed / deceleration;\n\n\t\tif ( destination < lowerMargin ) {\n\t\t\tdestination = wrapperSize ? lowerMargin - ( wrapperSize / 2.5 * ( speed / 8 ) ) : lowerMargin;\n\t\t\tdistance = Math.abs(destination - current);\n\t\t\tduration = distance / speed;\n\t\t} else if ( destination > 0 ) {\n\t\t\tdestination = wrapperSize ? wrapperSize / 2.5 * ( speed / 8 ) : 0;\n\t\t\tdistance = Math.abs(current) + destination;\n\t\t\tduration = distance / speed;\n\t\t}\n\n\t\treturn {\n\t\t\tdestination: Math.round(destination),\n\t\t\tduration: duration\n\t\t};\n\t};\n\n\tvar _transform = _prefixStyle('transform');\n\n\tme.extend(me, {\n\t\thasTransform: _transform !== false,\n\t\thasPerspective: _prefixStyle('perspective') in _elementStyle,\n\t\thasTouch: 'ontouchstart' in window,\n\t\thasPointer: !!(window.PointerEvent || window.MSPointerEvent), // IE10 is prefixed\n\t\thasTransition: _prefixStyle('transition') in _elementStyle\n\t});\n\n\t/*\n\tThis should find all Android browsers lower than build 535.19 (both stock browser and webview)\n\t- galaxy S2 is ok\n    - 2.3.6 : `AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1`\n    - 4.0.4 : `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S3 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S4 is badAndroid (stock brower, webview)\n     `AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30`\n   - galaxy S5 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n   - galaxy S6 is OK\n     `AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Mobile Safari/537.36 (Chrome/)`\n  */\n\tme.isBadAndroid = (function() {\n\t\tvar appVersion = window.navigator.appVersion;\n\t\t// Android browser is not a chrome browser.\n\t\tif (/Android/.test(appVersion) && !(/Chrome\\/\\d/.test(appVersion))) {\n\t\t\tvar safariVersion = appVersion.match(/Safari\\/(\\d+.\\d)/);\n\t\t\tif(safariVersion && typeof safariVersion === \"object\" && safariVersion.length >= 2) {\n\t\t\t\treturn parseFloat(safariVersion[1]) < 535.19;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t})();\n\n\tme.extend(me.style = {}, {\n\t\ttransform: _transform,\n\t\ttransitionTimingFunction: _prefixStyle('transitionTimingFunction'),\n\t\ttransitionDuration: _prefixStyle('transitionDuration'),\n\t\ttransitionDelay: _prefixStyle('transitionDelay'),\n\t\ttransformOrigin: _prefixStyle('transformOrigin'),\n\t\ttouchAction: _prefixStyle('touchAction')\n\t});\n\n\tme.hasClass = function (e, c) {\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\");\n\t\treturn re.test(e.className);\n\t};\n\n\tme.addClass = function (e, c) {\n\t\tif ( me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar newclass = e.className.split(' ');\n\t\tnewclass.push(c);\n\t\te.className = newclass.join(' ');\n\t};\n\n\tme.removeClass = function (e, c) {\n\t\tif ( !me.hasClass(e, c) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar re = new RegExp(\"(^|\\\\s)\" + c + \"(\\\\s|$)\", 'g');\n\t\te.className = e.className.replace(re, ' ');\n\t};\n\n\tme.offset = function (el) {\n\t\tvar left = -el.offsetLeft,\n\t\t\ttop = -el.offsetTop;\n\n\t\t// jshint -W084\n\t\twhile (el = el.offsetParent) {\n\t\t\tleft -= el.offsetLeft;\n\t\t\ttop -= el.offsetTop;\n\t\t}\n\t\t// jshint +W084\n\n\t\treturn {\n\t\t\tleft: left,\n\t\t\ttop: top\n\t\t};\n\t};\n\n\tme.preventDefaultException = function (el, exceptions) {\n\t\tfor ( var i in exceptions ) {\n\t\t\tif ( exceptions[i].test(el[i]) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tme.extend(me.eventType = {}, {\n\t\ttouchstart: 1,\n\t\ttouchmove: 1,\n\t\ttouchend: 1,\n\n\t\tmousedown: 2,\n\t\tmousemove: 2,\n\t\tmouseup: 2,\n\n\t\tpointerdown: 3,\n\t\tpointermove: 3,\n\t\tpointerup: 3,\n\n\t\tMSPointerDown: 3,\n\t\tMSPointerMove: 3,\n\t\tMSPointerUp: 3\n\t});\n\n\tme.extend(me.ease = {}, {\n\t\tquadratic: {\n\t\t\tstyle: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n\t\t\tfn: function (k) {\n\t\t\t\treturn k * ( 2 - k );\n\t\t\t}\n\t\t},\n\t\tcircular: {\n\t\t\tstyle: 'cubic-bezier(0.1, 0.57, 0.1, 1)',\t// Not properly \"circular\" but this looks better, it should be (0.075, 0.82, 0.165, 1)\n\t\t\tfn: function (k) {\n\t\t\t\treturn Math.sqrt( 1 - ( --k * k ) );\n\t\t\t}\n\t\t},\n\t\tback: {\n\t\t\tstyle: 'cubic-bezier(0.175, 0.885, 0.32, 1.275)',\n\t\t\tfn: function (k) {\n\t\t\t\tvar b = 4;\n\t\t\t\treturn ( k = k - 1 ) * k * ( ( b + 1 ) * k + b ) + 1;\n\t\t\t}\n\t\t},\n\t\tbounce: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tif ( ( k /= 1 ) < ( 1 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * k * k;\n\t\t\t\t} else if ( k < ( 2 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 1.5 / 2.75 ) ) * k + 0.75;\n\t\t\t\t} else if ( k < ( 2.5 / 2.75 ) ) {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.25 / 2.75 ) ) * k + 0.9375;\n\t\t\t\t} else {\n\t\t\t\t\treturn 7.5625 * ( k -= ( 2.625 / 2.75 ) ) * k + 0.984375;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\telastic: {\n\t\t\tstyle: '',\n\t\t\tfn: function (k) {\n\t\t\t\tvar f = 0.22,\n\t\t\t\t\te = 0.4;\n\n\t\t\t\tif ( k === 0 ) { return 0; }\n\t\t\t\tif ( k == 1 ) { return 1; }\n\n\t\t\t\treturn ( e * Math.pow( 2, - 10 * k ) * Math.sin( ( k - f / 4 ) * ( 2 * Math.PI ) / f ) + 1 );\n\t\t\t}\n\t\t}\n\t});\n\n\tme.tap = function (e, eventName) {\n\t\tvar ev = document.createEvent('Event');\n\t\tev.initEvent(eventName, true, true);\n\t\tev.pageX = e.pageX;\n\t\tev.pageY = e.pageY;\n\t\te.target.dispatchEvent(ev);\n\t};\n\n\tme.click = function (e) {\n\t\tvar target = e.target,\n\t\t\tev;\n\n\t\tif ( !(/(SELECT|INPUT|TEXTAREA)/i).test(target.tagName) ) {\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent\n\t\t\t// initMouseEvent is deprecated.\n\t\t\tev = document.createEvent(window.MouseEvent ? 'MouseEvents' : 'Event');\n\t\t\tev.initEvent('click', true, true);\n\t\t\tev.view = e.view || window;\n\t\t\tev.detail = 1;\n\t\t\tev.screenX = target.screenX || 0;\n\t\t\tev.screenY = target.screenY || 0;\n\t\t\tev.clientX = target.clientX || 0;\n\t\t\tev.clientY = target.clientY || 0;\n\t\t\tev.ctrlKey = !!e.ctrlKey;\n\t\t\tev.altKey = !!e.altKey;\n\t\t\tev.shiftKey = !!e.shiftKey;\n\t\t\tev.metaKey = !!e.metaKey;\n\t\t\tev.button = 0;\n\t\t\tev.relatedTarget = null;\n\t\t\tev._constructed = true;\n\t\t\ttarget.dispatchEvent(ev);\n\t\t}\n\t};\n\n\tme.getTouchAction = function(eventPassthrough, addPinch) {\n\t\tvar touchAction = 'none';\n\t\tif ( eventPassthrough === 'vertical' ) {\n\t\t\ttouchAction = 'pan-y';\n\t\t} else if (eventPassthrough === 'horizontal' ) {\n\t\t\ttouchAction = 'pan-x';\n\t\t}\n\t\tif (addPinch && touchAction != 'none') {\n\t\t\t// add pinch-zoom support if the browser supports it, but if not (eg. Chrome <55) do nothing\n\t\t\ttouchAction += ' pinch-zoom';\n\t\t}\n\t\treturn touchAction;\n\t};\n\n\tme.getRect = function(el) {\n\t\tif (el instanceof SVGElement) {\n\t\t\tvar rect = el.getBoundingClientRect();\n\t\t\treturn {\n\t\t\t\ttop : rect.top,\n\t\t\t\tleft : rect.left,\n\t\t\t\twidth : rect.width,\n\t\t\t\theight : rect.height\n\t\t\t};\n\t\t} else {\n\t\t\treturn {\n\t\t\t\ttop : el.offsetTop,\n\t\t\t\tleft : el.offsetLeft,\n\t\t\t\twidth : el.offsetWidth,\n\t\t\t\theight : el.offsetHeight\n\t\t\t};\n\t\t}\n\t};\n\n\treturn me;\n})();"
  },
  {
    "path": "src/wheel/build.json",
    "content": "{\n\t\"insert\": {\n\t\t\"OPTIONS\": \"\\t\\tmouseWheelSpeed: 20,\",\n\t\t\"NORMALIZATION\": \"\\tthis.options.invertWheelDirection = this.options.invertWheelDirection ? -1 : 1;\",\n\t\t\"_init\": \"\\t\\tif ( this.options.mouseWheel ) {\\n\\t\\t\\tthis._initWheel();\\n\\t\\t}\"\n\t}\n}"
  },
  {
    "path": "src/wheel/wheel.js",
    "content": "\n\t_initWheel: function () {\n\t\tutils.addEvent(this.wrapper, 'wheel', this);\n\t\tutils.addEvent(this.wrapper, 'mousewheel', this);\n\t\tutils.addEvent(this.wrapper, 'DOMMouseScroll', this);\n\n\t\tthis.on('destroy', function () {\n\t\t\tclearTimeout(this.wheelTimeout);\n\t\t\tthis.wheelTimeout = null;\n\t\t\tutils.removeEvent(this.wrapper, 'wheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'mousewheel', this);\n\t\t\tutils.removeEvent(this.wrapper, 'DOMMouseScroll', this);\n\t\t});\n\t},\n\n\t_wheel: function (e) {\n\t\tif ( !this.enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\te.preventDefault();\n\n\t\tvar wheelDeltaX, wheelDeltaY,\n\t\t\tnewX, newY,\n\t\t\tthat = this;\n\n\t\tif ( this.wheelTimeout === undefined ) {\n\t\t\tthat._execEvent('scrollStart');\n\t\t}\n\n\t\t// Execute the scrollEnd event after 400ms the wheel stopped scrolling\n\t\tclearTimeout(this.wheelTimeout);\n\t\tthis.wheelTimeout = setTimeout(function () {\n\t\t\tif(!that.options.snap) {\n\t\t\t\tthat._execEvent('scrollEnd');\n\t\t\t}\n\t\t\tthat.wheelTimeout = undefined;\n\t\t}, 400);\n\n\t\tif ( 'deltaX' in e ) {\n\t\t\tif (e.deltaMode === 1) {\n\t\t\t\twheelDeltaX = -e.deltaX * this.options.mouseWheelSpeed;\n\t\t\t\twheelDeltaY = -e.deltaY * this.options.mouseWheelSpeed;\n\t\t\t} else {\n\t\t\t\twheelDeltaX = -e.deltaX;\n\t\t\t\twheelDeltaY = -e.deltaY;\n\t\t\t}\n\t\t} else if ( 'wheelDeltaX' in e ) {\n\t\t\twheelDeltaX = e.wheelDeltaX / 120 * this.options.mouseWheelSpeed;\n\t\t\twheelDeltaY = e.wheelDeltaY / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'wheelDelta' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = e.wheelDelta / 120 * this.options.mouseWheelSpeed;\n\t\t} else if ( 'detail' in e ) {\n\t\t\twheelDeltaX = wheelDeltaY = -e.detail / 3 * this.options.mouseWheelSpeed;\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\twheelDeltaX *= this.options.invertWheelDirection;\n\t\twheelDeltaY *= this.options.invertWheelDirection;\n\n\t\tif ( !this.hasVerticalScroll ) {\n\t\t\twheelDeltaX = wheelDeltaY;\n\t\t\twheelDeltaY = 0;\n\t\t}\n\n\t\tif ( this.options.snap ) {\n\t\t\tnewX = this.currentPage.pageX;\n\t\t\tnewY = this.currentPage.pageY;\n\n\t\t\tif ( wheelDeltaX > 0 ) {\n\t\t\t\tnewX--;\n\t\t\t} else if ( wheelDeltaX < 0 ) {\n\t\t\t\tnewX++;\n\t\t\t}\n\n\t\t\tif ( wheelDeltaY > 0 ) {\n\t\t\t\tnewY--;\n\t\t\t} else if ( wheelDeltaY < 0 ) {\n\t\t\t\tnewY++;\n\t\t\t}\n\n\t\t\tthis.goToPage(newX, newY);\n\n\t\t\treturn;\n\t\t}\n\n\t\tnewX = this.x + Math.round(this.hasHorizontalScroll ? wheelDeltaX : 0);\n\t\tnewY = this.y + Math.round(this.hasVerticalScroll ? wheelDeltaY : 0);\n\n\t\tthis.directionX = wheelDeltaX > 0 ? -1 : wheelDeltaX < 0 ? 1 : 0;\n\t\tthis.directionY = wheelDeltaY > 0 ? -1 : wheelDeltaY < 0 ? 1 : 0;\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t}\n\n\t\tthis.scrollTo(newX, newY, 0);\n\n// INSERT POINT: _wheel\n\t},\n"
  },
  {
    "path": "src/zoom/build.json",
    "content": "{\n\t\"insert\": {\n\t\t\"OPTIONS\": \"\\t\\tzoomMin: 1,\\n\\t\\tzoomMax: 4, startZoom: 1,\",\n\t\t\"DEFAULTS\": \"\\tthis.scale = Math.min(Math.max(this.options.startZoom, this.options.zoomMin), this.options.zoomMax);\",\n\t\t\"_init\": \"\\t\\tif ( this.options.zoom ) {\\n\\t\\t\\tthis._initZoom();\\n\\t\\t}\"\n\t},\n\t\"replace\": {\n\t\t\"refresh\": \"zoom/refresh.js\",\n\t\t\"_translate\": \"\\t\\t\\tthis.scrollerStyle[utils.style.transform] = 'translate(' + x + 'px,' + y + 'px) scale(' + this.scale + ') ' + this.translateZ;\"\n\t}\n}"
  },
  {
    "path": "src/zoom/handleEvent.js",
    "content": "\n\thandleEvent: function (e) {\n\t\tswitch ( e.type ) {\n\t\t\tcase 'touchstart':\n\t\t\tcase 'pointerdown':\n\t\t\tcase 'MSPointerDown':\n\t\t\tcase 'mousedown':\n\t\t\t\tthis._start(e);\n\n\t\t\t\tif ( this.options.zoom && e.touches && e.touches.length > 1 ) {\n\t\t\t\t\tthis._zoomStart(e);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'touchmove':\n\t\t\tcase 'pointermove':\n\t\t\tcase 'MSPointerMove':\n\t\t\tcase 'mousemove':\n\t\t\t\tif ( this.options.zoom && e.touches && e.touches[1] ) {\n\t\t\t\t\tthis._zoom(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._move(e);\n\t\t\t\tbreak;\n\t\t\tcase 'touchend':\n\t\t\tcase 'pointerup':\n\t\t\tcase 'MSPointerUp':\n\t\t\tcase 'mouseup':\n\t\t\tcase 'touchcancel':\n\t\t\tcase 'pointercancel':\n\t\t\tcase 'MSPointerCancel':\n\t\t\tcase 'mousecancel':\n\t\t\t\tif ( this.scaled ) {\n\t\t\t\t\tthis._zoomEnd(e);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis._end(e);\n\t\t\t\tbreak;\n\t\t\tcase 'orientationchange':\n\t\t\tcase 'resize':\n\t\t\t\tthis._resize();\n\t\t\t\tbreak;\n\t\t\tcase 'transitionend':\n\t\t\tcase 'webkitTransitionEnd':\n\t\t\tcase 'oTransitionEnd':\n\t\t\tcase 'MSTransitionEnd':\n\t\t\t\tthis._transitionEnd(e);\n\t\t\t\tbreak;\n\t\t\tcase 'wheel':\n\t\t\tcase 'DOMMouseScroll':\n\t\t\tcase 'mousewheel':\n\t\t\t\tif ( this.options.wheelAction == 'zoom' ) {\n\t\t\t\t\tthis._wheelZoom(e);\n\t\t\t\t\treturn;\t\n\t\t\t\t}\n\t\t\t\tthis._wheel(e);\n\t\t\t\tbreak;\n\t\t\tcase 'keydown':\n\t\t\t\tthis._key(e);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n};"
  },
  {
    "path": "src/zoom/refresh.js",
    "content": "\n\tthis.scrollerWidth\t= Math.round(rect.width * this.scale);\n\tthis.scrollerHeight\t= Math.round(rect.height * this.scale);\n\n\tthis.maxScrollX\t\t= this.wrapperWidth - this.scrollerWidth;\n\tthis.maxScrollY\t\t= this.wrapperHeight - this.scrollerHeight;\n"
  },
  {
    "path": "src/zoom/zoom.js",
    "content": "\n\t_initZoom: function () {\n\t\tthis.scrollerStyle[utils.style.transformOrigin] = '0 0';\n\t},\n\n\t_zoomStart: function (e) {\n\t\tvar c1 = Math.abs( e.touches[0].pageX - e.touches[1].pageX ),\n\t\t\tc2 = Math.abs( e.touches[0].pageY - e.touches[1].pageY );\n\n\t\tthis.touchesDistanceStart = Math.sqrt(c1 * c1 + c2 * c2);\n\t\tthis.startScale = this.scale;\n\n\t\tthis.originX = Math.abs(e.touches[0].pageX + e.touches[1].pageX) / 2 + this.wrapperOffset.left - this.x;\n\t\tthis.originY = Math.abs(e.touches[0].pageY + e.touches[1].pageY) / 2 + this.wrapperOffset.top - this.y;\n\n\t\tthis._execEvent('zoomStart');\n\t},\n\n\t_zoom: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar c1 = Math.abs( e.touches[0].pageX - e.touches[1].pageX ),\n\t\t\tc2 = Math.abs( e.touches[0].pageY - e.touches[1].pageY ),\n\t\t\tdistance = Math.sqrt( c1 * c1 + c2 * c2 ),\n\t\t\tscale = 1 / this.touchesDistanceStart * distance * this.startScale,\n\t\t\tlastScale,\n\t\t\tx, y;\n\n\t\tthis.scaled = true;\n\n\t\tif ( scale < this.options.zoomMin ) {\n\t\t\tscale = 0.5 * this.options.zoomMin * Math.pow(2.0, scale / this.options.zoomMin);\n\t\t} else if ( scale > this.options.zoomMax ) {\n\t\t\tscale = 2.0 * this.options.zoomMax * Math.pow(0.5, this.options.zoomMax / scale);\n\t\t}\n\n\t\tlastScale = scale / this.startScale;\n\t\tx = this.originX - this.originX * lastScale + this.startX;\n\t\ty = this.originY - this.originY * lastScale + this.startY;\n\n\t\tthis.scale = scale;\n\n\t\tthis.scrollTo(x, y, 0);\n\t},\n\n\t_zoomEnd: function (e) {\n\t\tif ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.options.preventDefault ) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tvar newX, newY,\n\t\t\tlastScale;\n\n\t\tthis.isInTransition = 0;\n\t\tthis.initiated = 0;\n\n\t\tif ( this.scale > this.options.zoomMax ) {\n\t\t\tthis.scale = this.options.zoomMax;\n\t\t} else if ( this.scale < this.options.zoomMin ) {\n\t\t\tthis.scale = this.options.zoomMin;\n\t\t}\n\n\t\t// Update boundaries\n\t\tthis.refresh();\n\n\t\tlastScale = this.scale / this.startScale;\n\n\t\tnewX = this.originX - this.originX * lastScale + this.startX;\n\t\tnewY = this.originY - this.originY * lastScale + this.startY;\n\n\t\tif ( newX > 0 ) {\n\t\t\tnewX = 0;\n\t\t} else if ( newX < this.maxScrollX ) {\n\t\t\tnewX = this.maxScrollX;\n\t\t}\n\n\t\tif ( newY > 0 ) {\n\t\t\tnewY = 0;\n\t\t} else if ( newY < this.maxScrollY ) {\n\t\t\tnewY = this.maxScrollY;\n\t\t}\n\n\t\tif ( this.x != newX || this.y != newY ) {\n\t\t\tthis.scrollTo(newX, newY, this.options.bounceTime);\n\t\t}\n\n\t\tthis.scaled = false;\n\n\t\tthis._execEvent('zoomEnd');\n\t},\n\n\tzoom: function (scale, x, y, time) {\n\t\tif ( scale < this.options.zoomMin ) {\n\t\t\tscale = this.options.zoomMin;\n\t\t} else if ( scale > this.options.zoomMax ) {\n\t\t\tscale = this.options.zoomMax;\n\t\t}\n\n\t\tif ( scale == this.scale ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar relScale = scale / this.scale;\n\n\t\tx = x === undefined ? this.wrapperWidth / 2 : x;\n\t\ty = y === undefined ? this.wrapperHeight / 2 : y;\n\t\ttime = time === undefined ? 300 : time;\n\n\t\tx = x + this.wrapperOffset.left - this.x;\n\t\ty = y + this.wrapperOffset.top - this.y;\n\n\t\tx = x - x * relScale + this.x;\n\t\ty = y - y * relScale + this.y;\n\n\t\tthis.scale = scale;\n\n\t\tthis.refresh();\t\t// update boundaries\n\n\t\tif ( x > 0 ) {\n\t\t\tx = 0;\n\t\t} else if ( x < this.maxScrollX ) {\n\t\t\tx = this.maxScrollX;\n\t\t}\n\n\t\tif ( y > 0 ) {\n\t\t\ty = 0;\n\t\t} else if ( y < this.maxScrollY ) {\n\t\t\ty = this.maxScrollY;\n\t\t}\n\n\t\tthis.scrollTo(x, y, time);\n\t},\n\n\t_wheelZoom: function (e) {\n\t\tvar wheelDeltaY,\n\t\t\tdeltaScale,\n\t\t\tthat = this;\n\n\t\t// Execute the zoomEnd event after 400ms the wheel stopped scrolling\n\t\tclearTimeout(this.wheelTimeout);\n\t\tthis.wheelTimeout = setTimeout(function () {\n\t\t\tthat._execEvent('zoomEnd');\n\t\t}, 400);\n\n\t\tif ( 'deltaX' in e ) {\n\t\t\twheelDeltaY = -e.deltaY / Math.abs(e.deltaY);\n\t\t} else if ('wheelDeltaX' in e) {\n\t\t\twheelDeltaY = e.wheelDeltaY / Math.abs(e.wheelDeltaY);\n\t\t} else if('wheelDelta' in e) {\n\t\t\twheelDeltaY = e.wheelDelta / Math.abs(e.wheelDelta);\n\t\t} else if ('detail' in e) {\n\t\t\twheelDeltaY = -e.detail / Math.abs(e.wheelDelta);\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\tdeltaScale = this.scale + wheelDeltaY / 5;\n\n\t\tthis.zoom(deltaScale, e.pageX, e.pageY, 0);\n\t},\n"
  }
]