• Stars
    star
    487
  • Rank 90,352 (Top 2 %)
  • Language
    JavaScript
  • Created about 13 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Effortlessly create single page web sites with this jQuery plugin.

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

More Repositories

1

scrollIt.js

A jQuery plugin that makes it easy to create paginated, feature vertically scrolling pages.
JavaScript
539
star
2

smart-table-scroll

Build 1MM row tables with native scroll bars by reusing and yielding nodes.
JavaScript
538
star
3

datacomb

An interactive tool for exploring large, tabular datasets.
JavaScript
334
star
4

convertSTL

A utility for converting STL files between ASCII and binary encoding.
Ruby
74
star
5

hcluster.js

Agglomerative Hierarchical Clustering in JavaScript. (that plays nice with d3.js).
JavaScript
30
star
6

d3-annotate

πŸ“Œ Interactively and programmatically add, edit, move and save SVG chart annotations.
JavaScript
22
star
7

Apples-and-Oranges

An online version of Apples to Apples built with JavaScript.
JavaScript
14
star
8

distance.js

Vector distance and similarity measurements in JavaScript. eg: Euclidean, Manhattan, Chebyshev, angular distance.
JavaScript
9
star
9

canvas-dpi-scaler

Utility to scale <canvas> for Retina and other high resolution screens.
JavaScript
9
star
10

us-town-names-vis

d3.js visualization prototype code used to build: http://www.bytemuse.com/post/us-town-names-canvas-d3/
JavaScript
8
star
11

Rails_Quiz

A quiz generator built with Ruby on Rails
Ruby
5
star
12

project_euler

Solutions to Project Euler written elegantly in Ruby.
Ruby
3
star
13

nba-seasons-vis

Visualization prototype code and phantomJS script used to build http://www.bytemuse.com/post/nba-games-played-win-record-vis/
JavaScript
3
star
14

Node-Users

A simple login system to demonstrate Node.JS and CouchDB
JavaScript
3
star
15

stl-utilities

Command line utility tools for working with STL/3D printing models.
C
2
star
16

zencms

A model oriented CMS for developers, designers and their clients.
Ruby
2
star
17

Simple-Commerce

A simple, lightweight and flexible Ruby on Rails based eCommerce system.
Ruby
2
star
18

shiny-quantmod-boilerplate

Boilerplate for creating finance applications with Shiny and Quantmod.
R
2
star
19

ractive-range-slider

Ractive component for a range slider composed of two native <input type=range> elements.
JavaScript
1
star
20

dotfiles

. files
Shell
1
star
21

angle

ANother Graphing Library written in d3.js and CoffeeScript
CoffeeScript
1
star
22

lets-explore-dataset-1

[Blog post, visualization development] Let's explore a dataset #1: Seasonality in Air Traffic Routes
1
star