Presentr.js

A light weight HTML presentation framework

View the Project on GitHub oodzchen/presentr.js

Swipe left or right to continue

Hash Change: index end 0 1 2 3 4 5 6 7 8 9

Dist/Build

You should use files under dist/ folder for productions, files under build/ folder is only for developement purpose.

Build

Be sure you have install the gulp-cli at first

$ npm install --global gulp

install all dependencies:

$ npm install

build the developement version of Presentr.js

$ gulp build

The result is available in build/ folder.

Release

After you have made; build:

$ gulp dist

Distributalble version will available in dist/ folder.

Run the demo

You can run the demo if you have build the files

$ gulp server

Usage

The HTML structure should; be:

<div id="presentr">
  <div></div>
  <div></div>
  <div></div>
  <div></div>
  <div></div>
</div>

Use Presentr like this:

var presentr = new Presentr(document.querySelector('#presentr'));

Config Options

The second parameter of the Presentr function is an object for configs:

Example

var presentr = new Presentr(document.querySelector('#presentr'), {
  width: 1000,
  height: 800,
  startIndex: 0,
  cycle: true,
  speed: 400,
  lock: false,
  timingFunction: 'ease',
  effect: 'fade',
  activeClassName: 'active',
  navigation: {
    elements: document.querySelectorAll('#navigation>li'),
    eventType: 'click',
    activeClassName: 'nav-active'
  },
  enableHash: true,
  actionArea: document,
  onChangeStart: function(targetIndex, prevIndex){
    console.log(targetIndex, prevIndex);
  },
  onChangeEnd: function(index){
    console.log(index);
  }
});

API

Browser Support

Compatible with most of the modern browsers (Chrome, Firefox, Opera, IE10+), include the moblie platforms.

License

Copyright (c) 2015 Lin Chen. Licensed under The MIT License (MIT)