Smooth Scrolling Made Simple
Add Animated Page Targets To Your Website
-
Left Side Nav
Default style highlights the current page target.
-
Top Nav
Keep the controls fixed to the top of the page.
-
Right Side Nav
Oh, isn't this fancy? Switch the default positioning.
This plugin requires jQuery v1.3+ to function. Download the latest version of jQuery.
How It Works
Page Scroller is a simple and elegant navigation plugin that adds smooth scroll functionality to your web page. The plugin is so simple, you can animate any web site. Don't believe me? Try it yourself.
- Define the section parent. $(’#wrapper’).pageScroller()
- All sections within the parent are calculated.
- An animated page jump navigation is added.
HTML5 Mode Is your site structure built on HTML5?
No sweat, just enable HTML5 mode.
- Define the section parent. $(’body’).pageScroller({html5:true})
- Each <section> within the parent is calculated.
- A smooth scrolling <nav> element is added.
HTML4 Mode Not utilizing the power of HTML5?
It's okay, stay with the default setup.
What's Included?
Premium Navigation Package - 8 Elegant Skins
-
Standard Nav
Default List of Links
-
Icon Navies
Minimal Icon Links (10 ea.)
-
Top Nav Bar
Fixed Top Positioning
-
Up & Down Arrows
Toggleable Jump To Arrows
Beta Available - Try It Today!
Tablet & Mobile Support
Responsive Design
Documentation
-
Basic Usage
To enable the smooth scrolling plugin include the following files within head tag of HTML:
- jQuery v1.3+
- Page Scroller Plugin
- Page Scroller CSS
<script type="text/javascript" src="./javascripts/pagescroller.js"></script>
Getting Started
Instantiate the plugin on DOM load:
$(document).ready(function(){ $('#main').pageScroller(); });Rename Navigation Links
Custom navigation link names can be set by passing an array:
var navLabels = new Array('Home', 'Portfolio', 'Services', 'Contact'); $('#main').pageScroller({ navigation: navLabels }); -
Example HTML Structure
Sections must share a common class. All sections intended for smooth scrolling have an assumed class of "section" by default. Any block element can be substituted in place of both the sections and section parent. HTML5 elements are likewise supported. The JavaScript plugin will set the proper CSS positioning for the jQuery animation:
<div id="main"> <div class="section"></div> <div class="section"></div> <div class="section"></div> <div class="section"></div> <div class="section"></div> </div>
Change Section Class Name
To change the section class name, simply pass an alternative class when instantiating:
$('#main').pageScroller({ sectionClass: 'className' }); -
Available Options:
Property Default Description animationSpeed 500 transition speed between sections in (milliseconds) scrollOffset 20 top offset for smooth scroll destination point (pixels) sectionClass 'section default class name for Page Scroller sections navigationClass 'scrollNav' default class name for navigation menu navigation array a list of navigation link names, accepts an array animationBefore callback function performed before scrolling animation animationComplete callback function performed after scrolling animation onChange callback function performed when navigation is updated Example:
$('#main').pageScroller({ animationSpeed: 1000, scrollOffset: 0, sectionClass: 'page-sections', animationBefore: function(){ //execute 'before' callback } });API Controls:
Function Description next() animates page to next section prev() animates page to previous section goTo() animates page to specified section, slide number (integer) Example:
$('.button').click(function(){ pageScroller.goTo(4); });