GithubHelp home page GithubHelp logo

missjing / pagify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cmpolis/pagify

0.0 1.0 0.0 110 KB

Effortlessly create single page web sites with this jQuery plugin.

Home Page: http://cmpolis.github.com/Pagify

pagify's Introduction

Pagify.js

A jQuery plugin for effortlessly creating single page web sites. Demo

Features

  • Simple - include pagify.js, create a div, make one jQuery call and you're done!
  • Lightweight - pagify.js is far less than 100 lines of code, well commented and easy to understand and extend!
  • Flexible - Get started by only specifying a list of pages or customize animations, default pages and caching!
  • Fast - Load all pages upfront or load on the fly; a simple $.get() is used to get content with minimal proccessing!
  • Clean - Replace long HTML files broken up into sections and verbose JS to do the simple task of switching content!
  • Couldn't find an adjective... - Uses only Javascript and HTML so it can be uploaded like any other static site!

Usage

Checkout the simple demo to see how it works, or...

Create a container page:

Load Pagify and jQuery:

<script src="jquery.min.js" type="text/javascript"></script>
<script src="pagify.js" type="text/javascript"></script>

Create a div that will contain page content:

<div id='page_holder' />

Call pagify on the aforementioned div and pass in options. The only required option is pages.

$('#page_holder').pagify({
    pages: ['home', 'about', 'contact'],
    'default': 'home' // The name of a page or null for an empty div
});

Link to other pages by linking to hashes of their page names:

<a href='#contact'>Contact</a>
<a href='#about'>About</a>
...

Write other pages

Create content pages in the same directory as the container as [page_name].html

i.e. about.html

<h1>About us</h1>
<p>This is an about page!</p>

Options

pages - an array of page names. Required.

default - the page that is loaded on startup. null is default (for an empty div).

animation - the jQuery animation that is used to show pages, i.e. fadeIn, show, slideUp, slideDown. show is default.

animationSpeed - the speed of the animation, i.e. fast, slow, 1000. 'normal' is default.

animationOut - the jQuery animation that is used to hide pages, i.e. fadeOut, hide, slideUp, slideDown. hide is default.

animationOutSpeed - the speed of the animationOut, i.e. fast, slow, 1000. 0 is default.

cache - true or false. Determines if all pages are loaded upfront or not. false is default.

onChange - a function that takes the page name as a parameter and is executed when the page changes. empty function is default.

Etc...

Created by @ChrisPolis, blog

MIT License

pagify's People

Contributors

adampresley avatar cmpolis avatar crazy4groovy avatar deepakprasanna avatar puls avatar

Watchers

 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.