A web component built with Polymer 1.0, providing scrolling and pinch-zoom/panning via IScroll. Heavily based on x-iscoll (which is built with Polymer 0.3.3).
bower install rv-iscroll
<!-- Import it -->
<link rel="import" href="bower_components/rv-iscroll/rv-iscroll.html">
<!-- Use it! -->
<rv-iscroll><img src="http://placebear.com/400/400.jpg"></rv-iscroll>
Attribute | Options | Default | Description |
---|---|---|---|
zoom |
boolean | false |
Enables pinch to zoom. |
scrollY |
boolean | true |
Enables scroll on Y axis. |
scrollX |
boolean | false |
Enables scroll on X axis. |
freeScroll |
boolean | false |
Enables free panning when scroll on both axis is enabled. |
The tests are compatible with web-component-tester. Install it via:
npm install -g web-component-tester
Then, you can run your tests on all of your local browsers via:
wct
wct -l chrome
will only run tests in chrome.
wct -p
will keep the browsers alive after test runs (refresh to re-run).
wct test/some-file.html
will test only the files you specify.
<rv-iscroll> is released under the MIT License.
In lieu of a formal styleguide, take care to maintain the existing coding style.
To serve the component demo from this repo, run polyserve
in the project root (npm install -g polyserve
if you don't already have it). The demo will not work except in polyserve, which normalises the path to the polymer webcomponents polyfill
- To Matteo Spinelli, author of IScroll and many other fantastic projects.
- To Yannick Levif, upon whose <x-iscroll> <rv-iscroll> is heavily based.