项目作者: reinvanoyen

项目描述 :
Page transitions made easy
高级语言: JavaScript
项目地址: git://github.com/reinvanoyen/transito.git
创建时间: 2017-08-31T09:24:19Z
项目社区:https://github.com/reinvanoyen/transito

开源协议:

下载


Transito

Page transitions made easy

Installation

  1. $ npm install transito

Basic example

  1. import Transito from 'transito';
  2. let transito = new Transito('https://www.yourdomain.com', 'body', 'a');
  3. transito.on('progress', e => {
  4. console.log(e);
  5. });
  6. transito.on('postload', e => {
  7. console.log(e);
  8. });
  9. transito.on('preload', e => {
  10. console.log(e);
  11. });

Basic example with options

  1. new Transito('https://www.yourdomain.com', '#wrapper', 'a', {
  2. preload: false, // disables preloading on mouseover (default = true)
  3. cache: false, // disables caching of responses (default = true)
  4. minDuration: 2000, // sets minimum transition duration to 2 seconds (default = 800)
  5. classLoading: 'transitioning' // sets the class to be set on the body to "transitioning" (default = "loading")
  6. });