Skip to content

A Polymer 1.0 element for using iScroll, including scrolling, panning and pinch-zoom. Basically x-iscroll by YannickDot, upgraded to Polymer 1.0.

Notifications You must be signed in to change notification settings

itsravenous/rv-iscroll

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rv-iscroll

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).

Requirements

Polymer 1.0

Installation

bower install rv-iscroll

Usage

<!-- 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>

Options

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.

Testing

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 Tips

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.

License

<rv-iscroll> is released under the MIT License.

Contributing

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

Thanks

  1. To Matteo Spinelli, author of IScroll and many other fantastic projects.
  2. To Yannick Levif, upon whose <x-iscroll> <rv-iscroll> is heavily based.

About

A Polymer 1.0 element for using iScroll, including scrolling, panning and pinch-zoom. Basically x-iscroll by YannickDot, upgraded to Polymer 1.0.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages