{"id":13426839,"url":"https://github.com/peachananr/onepage-scroll","last_synced_at":"2025-10-22T19:55:21.017Z","repository":{"id":10577446,"uuid":"12785292","full_name":"peachananr/onepage-scroll","owner":"peachananr","description":"Create an Apple-like one page scroller website (iPhone 5S website) with One Page Scroll plugin","archived":false,"fork":false,"pushed_at":"2021-01-08T21:29:42.000Z","size":261,"stargazers_count":9533,"open_issues_count":269,"forks_count":2057,"subscribers_count":373,"default_branch":"master","last_synced_at":"2025-02-27T05:08:43.152Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://peachananr.github.io/onepage-scroll/Demo/demo.html","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ryanbriones/dbc-sinatra-crud-example","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peachananr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-12T14:07:28.000Z","updated_at":"2025-02-04T11:59:55.000Z","dependencies_parsed_at":"2022-07-12T22:30:30.649Z","dependency_job_id":null,"html_url":"https://github.com/peachananr/onepage-scroll","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peachananr%2Fonepage-scroll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peachananr%2Fonepage-scroll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peachananr%2Fonepage-scroll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peachananr%2Fonepage-scroll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peachananr","download_url":"https://codeload.github.com/peachananr/onepage-scroll/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243801600,"owners_count":20350105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T00:01:46.275Z","updated_at":"2025-10-22T19:55:16.000Z","avatar_url":"https://github.com/peachananr.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","目录","Scroll","Scroll [🔝](#readme)","UI","13. 页面交互","Web 前端","滚动"],"sub_categories":["插件","Other","其它","13.12 全屏滚动/全屏切换 ###","13.12 全屏滚动/全屏切换"],"readme":"#One Page Scroll 1.3.1 by Pete R.\nCreate an Apple-like one page scroll website (iPhone 5S website) with One Page Scroll plugin\nCreated by [Pete R.](http://www.thepetedesign.com), Founder of [BucketListly](http://www.bucketlistly.com)\n\nLicense: [Attribution-ShareAlike 4.0 International](http://creativecommons.org/licenses/by-sa/4.0/deed.en_US)\n\n\n## Requirement\n\njQuery (1.9.0 or later)\n\nnote: 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.\n\nsee: http://jsfiddle.net/33WJx/\n\n## Demo\n[View demo](http://peachananr.github.io/onepage-scroll/Demo/demo.html)\n\n## Compatibility\nModern browsers such as Chrome, Firefox, and Safari on both desktop and smartphones have been tested. Should work fine on IE8 and IE9 as well.\n\n## Basic Usage\nOne 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.\n\n\nTo add this to your website, simply include the latest jQuery library together with `jquery.onepage-scroll.js`, `onepage-scroll.css` into your document's `\u003chead\u003e` and call the function as follows:\n\n````html\n\u003cbody\u003e\n  ...\n  \u003cdiv class=\"main\"\u003e\n    \u003csection\u003e...\u003c/section\u003e\n    \u003csection\u003e...\u003c/section\u003e\n    ...\n  \u003c/div\u003e\n  ...\n\u003c/body\u003e\n````\nContainer \"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:\n\n````javascript\n$(\".main\").onepage_scroll({\n   sectionContainer: \"section\",     // sectionContainer accepts any kind of selector in case you don't want to use section\n   easing: \"ease\",                  // Easing options accepts the CSS3 easing animation such \"ease\", \"linear\", \"ease-in\",\n                                    // \"ease-out\", \"ease-in-out\", or even cubic bezier value such as \"cubic-bezier(0.175, 0.885, 0.420, 1.310)\"\n   animationTime: 1000,             // AnimationTime let you define how long each section takes to animate\n   pagination: true,                // You can either show or hide the pagination. Toggle true for show, false for hide.\n   updateURL: false,                // Toggle this true if you want the URL to be updated automatically when the user scroll to each page.\n   beforeMove: function(index) {},  // This option accepts a callback function. The function will be called before the page moves.\n   afterMove: function(index) {},   // This option accepts a callback function. The function will be called after the page moves.\n   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.\n   keyboard: true,                  // You can activate the keyboard controls\n   responsiveFallback: false,        // You can fallback to normal page scroll by defining the width of the browser in which\n                                    // you want the responsive fallback to be triggered. For example, set this to 600 and whenever\n                                    // the browser's width is less than 600, the fallback will kick in.\n   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\".  \n});\n````\nAnd 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.\n\n## Keyboard Shortcuts\nYou can trigger page move with hotkeys as well:\n\n### Up arrow / Page Up\nPressing the up arrow or the page up key allows you to move the page up by one.\n\n\n### Down arrow / Page Donw\nPressing the down arrow or the page down key allows you to move the page down by one.\n\n### Spacebar\nPressing the space key allows you to move the page down by one.\n\n### Home\nPressing the home key brings you back to the first page.\n\n\n### End\nPressing the end key brings you to the last page.\n\n## Public Methods\nYou can also trigger page move programmatically as well:\n\n### $.fn.moveUp()\nThis method allows you to move the page up by one. This action is equivalent to scrolling up/swiping down.\n\n````javascript\n  $(\".main\").moveUp();\n````\n\n### $.fn.moveDown()\nThis method allows you to move the page down by one. This action is equivalent to scrolling down/swiping up.\n\n````javascript\n  $(\".main\").moveDown();\n````\n\n### $.fn.moveTo(page_index)\nThis method allows you to move to the specified page index programatically.\n\n````javascript\n  $(\".main\").moveTo(3);\n````\n\n## Callbacks\nYou can use callbacks to perform actions before or after the page move.\n\n### beforeMove(current_page_index)\nThis callback gets called before the plugin performs its move.\n\n````javascript\n  $(\".main\").onepage_scroll({\n    beforeMove: function(index) {\n      ...\n    }\n  });\n````\n\n### afterMove(next_page_index)\nThis callback gets called after the move animation was performed.\n\n````javascript\n  $(\".main\").onepage_scroll({\n    afterMove: function(index) {\n      ...\n    }\n  });\n````\n\nIf 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).\n\n## Other Resources\n- [OnePageScroll.js: Creating an Apple’s iPhone 5S Website](http://www.onextrapixel.com/2013/09/18/onepagescroll-js-creating-an-apples-iphone-5s-website/)\n- [Eike Send's jQuery Swipe Events](https://github.com/eikes/jquery.swipe-events.js)\n- [CSS Easing generator by Matthew Lein](http://matthewlein.com/ceaser/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeachananr%2Fonepage-scroll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeachananr%2Fonepage-scroll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeachananr%2Fonepage-scroll/lists"}