Giter Site home page Giter Site logo

wankypages's Introduction

Wanky Pages

Page switching management with 3D/2D CSS3 transition support.

Demo

http://demo.peterbailey.eu/wankyPages/example.php

See below for other animations.

Usage

  1. Add animations.css

    <link rel="stylesheet" type="text/css" href="animations.css">
  2. Add foundation styles for pages

    .wanky_pages {
        position: absolute;
        width: 100%;
        height: 100%;
        -webkit-perspective: 1200px;
        -moz-perspective: 1200px;
        perspective: 1200px;
        -webkit-transform-style: preserve-3d;
        -moz-transform-style: preserve-3d;
        transform-style: preserve-3d;
    }
    
    .wanky_page {
        -webkit-animation-duration: 2s;
        -moz-animation-duration: 2s;
        width: 100%;
        height: 100%;
        position: absolute;
        top: 0;
        left: 0;
        visibility: hidden;
        overflow: auto;
        -webkit-backface-visibility: hidden;
        -moz-backface-visibility: hidden;
        backface-visibility: hidden;
        -webkit-transform: translate3d(0, 0, 0);
        -moz-transform: translate3d(0, 0, 0);
        transform: translate3d(0, 0, 0);
    }
    
    .wanky_current_page {
        visibility: visible;
    }
    
    .wanky_page_top {
        z-index: 4;
    }
  3. Add Page markup

    <div id="pages" class="wanky_pages">
    
        <div class="wanky_page" data-pageid="1">
            <h1>Page 1</h1>
            <a href="#2">Next</a>
        </div>
        
        <div class="wanky_page" data-pageid="2">
            <h1>Page 2</h2>
            <a href="#3">Next</a>
        </div>
        
        <div class="wanky_page" data-pageid="3">
            <h1>Page 3</h1>
            <a href="#1">Next</a>
        </div>
    
    </div>
  4. Add Javascript dependencies

    <script src="jquery.js"></script>
    <script src="modernizr.custom.js"></script>
    <script src="wankypages.jquery.js"></script>
  5. Load the plugin

    $(document).ready(function(){
    
        $('#pages').wankyPages({
    
            selector_prefix   : 'wanky_',                             // Prefix to give all classes and ID's
            default_page      : 1,                                    // Default/ first page to load
            
            animation         : 'moveUnfoldTopBottom',                // Animation to used. Change to false to use overrides
            
            leftInAnimation   : 'pt-page-moveFromLeft',               // Override left-in animation
            leftOutAnimation  : 'pt-page-moveToRight',                // Override left-out animatino
            
            rightInAnimation  : 'pt-page-moveFromRight',              // Override right-in animation
            rightOutAnimation : 'pt-page-moveToLeft',                 // Override right-out animation
            
            onBeforeChange    : function(next_page, current_page){},  // Function to call before page changes
            onAfterChange     : function(){},                         // Function to call after page changes
            onBeforeLoad      : function(){},                         // Function to call before plugin loads
            onInterval        : function(current_page){}              // Function to call on page checking interval
    
        });
    
    });

Supported Animations

wankypages's People

Contributors

pea avatar

Watchers

James Cloos avatar Blair Jersyer avatar  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.