peachananr /onepage-scroll
Create an Apple-like one page scroller website (iPhone 5S website) with One Page Scroll plugin
★ 9,463⑂ 1,978👁 360⑃ 98● 267▤ 5
+0
日增长
9,463
stars
1,978
forks
360
watchers
98
prs
267
issues
5
releases
README
One Page Scroll 1.3.1 by Pete R.
Create an Apple-like one page scroll website (iPhone 5S website) with One Page Scroll plugin
Created by Pete R., Founder of BucketListly
License: Attribution-ShareAlike 4.0 International
Requirement
jQuery (1.9.0 or later)
note: jQuery 1.9.0 or later is strongly recommended because using jQuery less than 1.8.3 and jquery.onepage-scroll.js together turns out to be a hash-based XSS vulnerabiliry.
see: http://jsfiddle.net/33WJx/
Demo
View demo
Compatibility
Modern browsers such as Chrome, Firefox, and Safari on both desktop and smartphones have been tested. Should work fine on IE8 and IE9 as well.
Basic Usage
One Page Scroll let you transform your website into a one page scroll website that allows users to scroll one page at a time. It is perfect for creating a website in which you want to present something to the viewers. For example, Apple's iPhone 5S website uses the same technique.
To add this to your website, simply include the latest jQuery library together with jquery.onepage-scroll.js, onepage-scroll.css into your document's and call the function as follows:
html
...
...
...
...
...
Container "Main" must be one level below the body tag in order to make it work full page. Now call the function to activate as follows:
javascript
$(".main").onepage_scroll({
sectionContainer: "section", // sectionContainer accepts any kind of selector in case you don't want to use section
easing: "ease", // Easing options accepts the CSS3 easing animation such "ease", "linear", "ease-in",
// "ease-out", "ease-in-out", or even cubic bezier value such as "cubic-bezier(0.175, 0.885, 0.420, 1.310)"
animationTime: 1000, // AnimationTime let you define how long each section takes to animate
pagination: true, // You can either show or hide the pagination. Toggle true for show, false for hide.
updateURL: false, // Toggle this true if you want the URL to be updated automatically when the user scroll to each page.
beforeMove: function(index) {}, // This option accepts a callback function. The function will be called before the page moves.
afterMove: function(index) {}, // This option accepts a callback function. The function will be called after the page moves.
loop: false, // You can have the page loop back to the top/bottom when the user navigates at up/down on the first/last page.
keyboard: true, // You can activate the keyboard controls
responsiveFallback: false, // You can fallback to normal page scroll by defining the width of the browser in which
// you want the responsive fallback to be triggered. For example, set this to 600 and whenever
// the browser's width is less than 600, the fallback will kick in.
direction: "vertical" // YoTop issues
#174Disable one-page scrolling when over some div.29 comments · 2014-07-08#6how to link slides via a menu not pagination ?29 comments · 2013-09-25#96Scrolling on touch devices 24 comments · 2014-01-28#43Not support IE9 15 comments · 2013-10-24#81iOS7 scrolling not smooth after the first scroll13 comments · 2013-12-17#167jQuery version not working on mobile12 comments · 2014-06-23#37Adding the Navigation with our own text?12 comments · 2013-10-16#178Is it possible scroll rest of the page content after slide is completed11 comments · 2014-07-13
Latest release
Add IE8+ Support, Spacebar shortcut key, Fixed Bower 1.3.1 2014-08-26Add IE8+ Support, Spacebar shortcut key, Fixed Bower