Coder Social home page Coder Social logo

facelesslucifer / onepage-scroll Goto Github PK

View Code? Open in Web Editor NEW

This project forked from peachananr/onepage-scroll

0.0 2.0 0.0 311 KB

Create an Apple-like one page scroller website (iPhone 5S website) with One Page Scroll plugin

Home Page: http://www.thepetedesign.com/demos/onepage_scroll_demo.html

onepage-scroll's Introduction

#One Page Scroll 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

One Page Scroll

Demo

View demo

Compatibility

Modern browsers such as Chrome, Firefox, and Safari on both desktop and smartphones have been tested. Not tested on IE.

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 <head> and call the function as follows:

<body>
  ...
  <div class="main">
    <section>...</section>
    <section>...</section>
    ...
  </div>
  ...
</body>

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:

$(".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.
});

And that's it. Now, your website should work the same way Apple's iPhone 5S website does. You should be able to swipe up/down as well (thanks to Eike Send for his swipe events!) when viewing your website on mobile phones.

Public Methods

You can also trigger page move programmatically as well:

$.fn.moveUp()

This method allows you to move the page up by one. This action is equivalent to scrolling up/swiping down.

  $(".main").moveUp();

$.fn.moveDown()

This method allows you to move the page down by one. This action is equivalent to scrolling down/swiping up.

  $(".main").moveDown();

If you want to see more of my plugins, visit The Pete Design, or follow me on Twitter and Github.

Other Resources

onepage-scroll's People

Contributors

peachananr avatar

Watchers

James Cloos avatar Ye Lin Htun 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.