Giter Site home page Giter Site logo

pageswapper's Introduction

#pageSwapper 单页应用页面导航库

适用于mobile web或cordova、phonegap webapp、无兼容要求单页PC应用等。

可自定义的css3动画效果,提供回调接口,当前页面与下个页面切换结束后删除,永远保留一个页面。

搭配backbone效果更佳,纯原生js,不需要依赖其他库。

###Demo

##如何使用 引入相关的CSS以及JS, 如下:

<link rel="stylesheet" href="page.css">

<script src="pageSwapper.js"></script>

HTML结构需要有一定的要求:

body
	page // 当前页
	page // 即将切换的下一个页面,切换时生成

// 每个page是个满屏元素, 相当于一个独立的页面。

调用方法:

Swapper(elem1, elem2, config, callback);

// elem1 是DOM存在的元素
// elem2 是DOM还不存在的元素
// config可自定义
// callback 切换结束时回调

config = {
    animateOne: // 默认 'slideouttoleft', 对应 css3 @-webkit-keyframes slideouttoleft
    animateTwo: // 默认 'slideinfromright', 对应 css3 @-webkit-keyframes slideinfromright
    duration: // 默认 400,
    easing: // 默认 'ease-in-out'
};

pageswapper's People

Contributors

dongshaohan avatar

Stargazers

 avatar  avatar Qmore avatar  avatar  avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.