PHPackages                             peachananr/onepage-scroll - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. peachananr/onepage-scroll

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

peachananr/onepage-scroll
=========================

Скролл по секциям

0121JavaScript

Since Sep 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ange187/onepage-scroll)[ Packagist](https://packagist.org/packages/peachananr/onepage-scroll)[ RSS](/packages/peachananr-onepage-scroll/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#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.](http://www.thepetedesign.com), Founder of [BucketListly](http://www.bucketlistly.com)

License: [Attribution-ShareAlike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/deed.en_US)

[![One Page Scroll](https://camo.githubusercontent.com/d9ed5a435d93ed55e2b070ea8d5adbf47bfc6e6477137220086e2d7cfcbc221c/687474703a2f2f7777772e7468657065746564657369676e2e636f6d2f696d616765732f6f6e65706167655f7363726f6c6c5f696d6167652e706e67 "One Page Scroll")](http://www.thepetedesign.com/demos/onepage_scroll_demo.html)

Requirement
-----------

[](#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:

Demo
----

[](#demo)

[View demo](http://www.thepetedesign.com/demos/onepage_scroll_demo.html)

Compatibility
-------------

[](#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
-----------

[](#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](http://www.apple.com/iphone-5s/) 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:

```

  ...

    ...
    ...
    ...

  ...

```

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.
   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"            // You can now define the direction of the One Page Scroll animation. Options available are "vertical" and "horizontal". The default value is "vertical".
});
```

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](https://github.com/eikes) for his swipe events!) when viewing your website on mobile phones.

Keyboard Shortcuts
------------------

[](#keyboard-shortcuts)

You can trigger page move with hotkeys as well:

### Up arrow / Page Up

[](#up-arrow--page-up)

Pressing the up arrow or the page up key allows you to move the page up by one.

### Down arrow / Page Donw

[](#down-arrow--page-donw)

Pressing the down arrow or the page down key allows you to move the page down by one.

### Spacebar

[](#spacebar)

Pressing the space key allows you to move the page down by one.

### Home

[](#home)

Pressing the home key brings you back to the first page.

### End

[](#end)

Pressing the end key brings you to the last page.

Public Methods
--------------

[](#public-methods)

You can also trigger page move programmatically as well:

### $.fn.moveUp()

[](#fnmoveup)

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

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

### $.fn.moveDown()

[](#fnmovedown)

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

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

### $.fn.moveTo(page\_index)

[](#fnmovetopage_index)

This method allows you to move to the specified page index programatically.

```
  $(".main").moveTo(3);
```

Callbacks
---------

[](#callbacks)

You can use callbacks to perform actions before or after the page move.

### beforeMove(current\_page\_index)

[](#beforemovecurrent_page_index)

This callback gets called before the plugin performs its move.

```
  $(".main").onepage_scroll({
    beforeMove: function(index) {
      ...
    }
  });
```

### afterMove(next\_page\_index)

[](#aftermovenext_page_index)

This callback gets called after the move animation was performed.

```
  $(".main").onepage_scroll({
    afterMove: function(index) {
      ...
    }
  });
```

If you want to see more of my plugins, visit [The Pete Design](http://www.thepetedesign.com/#design), or follow me on [Twitter](http://www.twitter.com/peachananr) and [Github](http://www.github.com/peachananr).

Other Resources
---------------

[](#other-resources)

- [OnePageScroll.js: Creating an Apple’s iPhone 5S Website](http://www.onextrapixel.com/2013/09/18/onepagescroll-js-creating-an-apples-iphone-5s-website/)
- [Eike Send's jQuery Swipe Events](https://github.com/eikes/jquery.swipe-events.js)
- [CSS Easing generator by Matthew Lein](http://matthewlein.com/ceaser/)

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/66efa4c4cf0d387e8085081b04af668bc3dc7ebea307683bcd5744d08ed1d235?d=identicon)[ange187](/maintainers/ange187)

---

Top Contributors

[![peachananr](https://avatars.githubusercontent.com/u/897308?v=4)](https://github.com/peachananr "peachananr (34 commits)")[![i-am-kenny](https://avatars.githubusercontent.com/u/2099903?v=4)](https://github.com/i-am-kenny "i-am-kenny (3 commits)")[![uniphil](https://avatars.githubusercontent.com/u/205128?v=4)](https://github.com/uniphil "uniphil (3 commits)")[![ange187](https://avatars.githubusercontent.com/u/13964595?v=4)](https://github.com/ange187 "ange187 (3 commits)")[![lipis](https://avatars.githubusercontent.com/u/125676?v=4)](https://github.com/lipis "lipis (1 commits)")[![kevva](https://avatars.githubusercontent.com/u/709159?v=4)](https://github.com/kevva "kevva (1 commits)")[![peterdemin](https://avatars.githubusercontent.com/u/1448666?v=4)](https://github.com/peterdemin "peterdemin (1 commits)")

### Embed Badge

![Health badge](/badges/peachananr-onepage-scroll/health.svg)

```
[![Health](https://phpackages.com/badges/peachananr-onepage-scroll/health.svg)](https://phpackages.com/packages/peachananr-onepage-scroll)
```

###  Alternatives

[fx3costa/laravelchartjs

Simple package to facilitate and automate the use of charts in Laravel 5.x using Chartjs v2 library

484479.2k4](/packages/fx3costa-laravelchartjs)[christiankuri/laravel-favorite

Allows Laravel Eloquent models to implement a 'favorite' or 'remember' or 'follow' feature.

226479.8k6](/packages/christiankuri-laravel-favorite)[magefan/module-lazyload

Images lazyloading on Magento 2 store.

54185.8k3](/packages/magefan-module-lazyload)[burdamagazinorg/thunder-project

Project template for Thunder projects with composer

2727.2k](/packages/burdamagazinorg-thunder-project)[aucor/polylang-smart-language-select-disabler

134.6k](/packages/aucor-polylang-smart-language-select-disabler)[daxslab/yii2-taggedview

Extension to help setup the standard HTML meta tags besides the ones defined by Opengraph and Twitter to contribute to website SEO

114.7k1](/packages/daxslab-yii2-taggedview)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
