Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JavaScript HTML CSS
branch: master

Up

latest commit 2c30ff0f9f
Anton Johansson authored
Failed to load latest commit information.
dist ScrollInfo object
examples ScrollInfo object
src ScrollInfo object
.gitignore Gulp
README.md Update README.md
bower.json Up
gulpfile.js Cleanup
package.json Up

README.md

viewpager.js

Basic usage

...
var  w = view_pager_elem.getBoundingClientRect().width;

var vp = new ViewPager(view_pager_elem, {
  pages: item_container.children.length,
  onPageScroll : function (scrollInfo) {
    offset = -scrollInfo.totalOffset;
    item_container.style['-webkit-transform'] = 'translate3d(' + (-scrollInfo.totalOffset * w) + 'px, 0px, 0px)';
  },

  onPageChange : function (page) {
    console.log('page', page);
  }
});
Something went wrong with that request. Please try again.