
| Created by @imac2
A simple and easy to use library that creates fullscreen scrolling websites (also known as single page websites or onepage sites) and adds landscape sliders inside the sections of the site.
Suggestion are more than welcome, not only for feature requests but also for coding style improvements. Let's make this a great library to make people's lives easier!
fullPage.js is fully functional on all modern browsers and with IE 11. If you need to support IE < 11 consider using fullPage.js v3. It also provides touch support for mobile phones, tablets and touch screen computers.
Special thanks to Browserstack for supporting fullpage.js.
If you want to use fullPage to develop non open sourced sites, themes, projects, and applications, the Commercial license is the appropriate license. With this option, your source code is kept proprietary. Which means, you won't have to change your whole application source code to an open source license. [Purchase a Fullpage Commercial License]
If you are creating an open source application under a license compatible with the GNU GPL license v3, you may use fullPage under the terms of the GPLv3.
You will have to provide a prominent notice that fullPage.js is in use. The credit comments in the JavaScript and CSS files should be kept intact (even after combination or minification).
Read more about fullPage's license.
As you can see in the example files, you will need to include:
fullpage.js (or its minified version fullpage.min.js)fullpage.cssOptionally, when using css3:false, you can add the easings file in case you want to use other easing effects apart from the one included in the library (easeInOutCubic).
Optionally, you can install fullPage.js with bower or npm if you prefer:
Terminal:
// With bower bower install fullpage.js // With npm npm install fullpage.js
<link rel="stylesheet" type="text/css" href="fullpage.css" /> <!-- This following line is optional. Only necessary if you use the option css3:false and you want to use other easing effects rather than "easeInOutCubic". --> <script src="vendors/easings.min.js"></script> <script type="text/javascript" src="fullpage.js"></script>
Using Webpack, Browserify or Require.js? Check how to use fullPage.js with module loaders.
If you prefer to use a CDN to load the needed files, fullPage.js is in CDNJS: https://cdnjs.com/libraries/fullPage.js
Start your HTML document with the compulsory HTML DOCTYPE declaration on the 1st line of your HTML code. You might have troubles with sections heights otherwise. The examples provided use HTML 5 doctype <!DOCTYPE html>.
Each section will be defined with an element containing the section class.
The active section by default will be the first section, which is taken as the home page.
Sections should be placed inside a wrapper (<div id="fullpage"> in this case). The wrapper can not be the body element.
<div id="fullpage"> <div class="section">Some section</div> <div class="section">Some section</div> <div class="section">Some section</div> <div class="section">Some section</div> </div>
If you want to define a different starting point rather than the first section or the first slide of a section, just add the class active to the section and slide you want to load first.
<div class="section active">Some section</div>
In order to create a landscape slider within a section, each slide will be defined by default with an element containing the slide class:
<div class="section"> <div class="slide"> Slide 1 </div> <div class="slide"> Slide 2 </div> <div class="slide"> Slide 3 </div> <div class="slide"> Slide 4 </div> </div>
You can see a fully working example of the HTML structure in the simple.html file.
All you need to do is call fullPage.js before the closing </body> tag.
new fullpage('#fullpage', { //options here autoScrolling:true, scrollHorizontally: true });
You can use fullpage.js as a jQuery plugin if you want to!
$(document).ready(function() { $('#fullpage').fullpage({ //options here autoScrolling:true, scrollHorizontally: true }); // Example of how to use fullpage.js methods $.fn.fullpage.setAllowScrolling(false); });
A more complex initialization with all options set could look like this:
var myFullpage = new fullpage('#fullpage', { // Navigation menu: '#menu', lockAnchors: false, anchors:['firstPage', 'secondPage'], navigation: false, navigationPosition: 'right', navigationTooltips: ['firstSlide', 'secondSlide'], showActiveTooltip: false, slidesNavigation: false, slidesNavPosition: 'bottom', // Scrolling css3: true, scrollingSpeed: 700, autoScrolling: true, fitToSection: true, fitToSectionDelay: 600, scrollBar: false, easing: 'easeInOutCubic', easingcss3: 'ease', loopBottom: false, loopTop: false, loopHorizontal: true, continuousVertical: false, continuousHorizontal: false, scrollHorizontally: false, interlockedSlides: false, dragAndMove: false, offsetSections: false, resetSliders: false, fadingEffect: false, normalScrollElements: '#element1, .element2', scrollOverflow: true, scrollOverflowMacStyle: false, scrollOverflowReset: false, skipIntermediateItems: false, touchSensitivity: 15, bigSectionsDestination: null, // Accessibility keyboardScrolling: true, animateAnchor: true, recordHistory: true, // Design controlArrows: true, controlArrowsHTML: [ '<div class="fp-arrow"></div>', '<div class="fp-arrow"></div>' ], verticalCentered: true, sectionsColor : ['#ccc', '#fff'], paddingTop: '3em', paddingBottom: '10px', fixedElements: '#header, .footer', responsiveWidth: 0, responsiveHeight: 0, responsiveSlides: false, parallax: false, parallaxOptions: {type: 'reveal', percentage: 62, property: 'translate'}, dropEffect: false, dropEffectOptions: { speed: 2300, color: '#F82F4D', zIndex: 9999}, waterEffect: false, waterEffectOptions: { animateContent: true, animateOnMouseMove: true}, cards: false, cardsOptions: {perspective: 100, fadeContent: true, fadeBackground: true}, // Custom selectors sectionSelector: '.section', slideSelector: '.slide', lazyLoading: true, observer: true, credits: { enabled: true, label: 'Made with fullPage.js', position: 'right'}, // Events beforeLeave: function(origin, destination, direction, trigger){}, onLeave: function(origin, destination, direction, trigger){}, afterLoad: function(origin, destination, direction, trigger){}, afterRender: function(){}, afterResize: function(width, height){}, afterReBuild: function(){}, afterResponsive: function(isResponsive){}, afterSlideLoad: function(section, origin, destination, direction, trigger){}, onSlideLeave: function(section, origin, destination, direction, trigger){}, onScrollOverflow: function(section, slide, position, direction){} });
If you are using fullPage.js with anchor links for the sections (using the anchors option or the attribute data-anchor in each section), then you will be able to use anchor links also to navigate directly to a certain slide inside a section.
This would be an example of a link with an anchor: https://alvarotrigo.com/fullPage/#secondPage/2 (which is the URL you will see once you access to that section/slide manually)
Notice the last part of the URL ends in #secondPage/2.
Having the following initialization:
new fullpage('#fullpage', { anchors:['firstPage', 'secondPage', 'thirdPage'] });
The anchor at the end of the URL #secondPage/2 defines the section and slide of destination respectively. In the previous URL, the section of destination will be the one defined with the anchor secondPage and the slide will be the 2nd slide, as we are using the index 2 for it. (the fist slide of a section has index 0, as technically it is a section).
We could have used a custom anchor for the slide instead of its index if we would have used the attribute data-anchor on the HTML markup like so:
<div class="section"> <div class="slide" data-anchor="slide1"> Slide 1 </div> <div class="slide" data-anchor="slide2"> Slide 2 </div> <div class="slide" data-anchor="slide3"> Slide 3 </div> <div class="slide" data-anchor="slide4"> Slide 4 </div> </div>
In this last case, the URL we would use would be #secondPage/slide3, which is the equivalent to our previous #secondPage/2.
Note that section anchors can also be defined in the same way, by using the data-anchor attribute, if no anchors array is provided.
Be careful! data-anchor tags can not have the same value as any ID element on the site (or NAME element for IE).
Demo fullPage.js provides a way to remove the full height restriction from its sections and slides. It is possible to create sections which height is smaller or bigger than the viewport. This is ideal for footers. It is important to realise that it doesn't make sense to have all of your sections using this feature. If there is more than one section in the initial load of the site, fullPage.js won't scroll at all to see the next one as it will be already in the viewport.
To create smaller sections just use the class fp-auto-height in the section you want to apply it. It will then take the height defined by your section/slide content.
<div class="section">Whole viewport</div> <div class="section fp-auto-height">Auto height</div>
Demo A responsive auto height can be applied by using the class fp-auto-height-responsive. This way sections will be fullscreen until the responsive mode gets fired. Then they'll take the size required by their content, which could be bigger or smaller than the viewport.
Fullpage.js adds multiple classes in different elements to keep a record of the status of the site:
active is added the current visible section and slide.active is added to the current menu element (if using the menu option).fp-viewing-SECTION-SLIDE is added to the body element of the site. (eg:

职场AI,就用扣子
AI办公助手,复杂任务高效处理。办公效率低?扣子空间AI助手支持播客生成、PPT制作、网页开发及报告写作,覆盖科研、商业、舆情等领域的专家Agent 7x24小时响应,生活工作无缝切换,提升50%效率!


多风格AI绘画神器
堆友平台由阿里巴巴设计团队创建,作为一款AI驱动的设计工具,专为设计师提供一站式增长服务。功能覆盖海量3D素材、AI绘画、实时渲染以及专业抠图,显著提升设计品质和效率。平台不仅提供工具,还是一个促进创意交流和个人发展的空间,界面友好,适合所有级别的设计师和创意工作者。


零代码AI应用开发平台
零代码AI应用开发平台,用户只需一句话简单描述需求,AI能自动生成小程序、APP或H5网页应用,无需编写代码。


免费创建高清无水印Sora视频
Vora是一个免费创建高清无水印Sora视频的AI工具


最适合小白的AI自动化工作流平台
无需编码,轻松生成可复用、可变现的AI自动化工作流

大模型驱动的Excel数据处理工具
基于大模型交互的表格处理系统,允许用户通过对话方式完成数据整理和可视化分析。系统采用机器学习算法解析用户指令,自动执行排序、公式计算和数据透视等操作,支持多种文件格式导入导出。数据处理响应速度保持在0.8秒以内,支持超过100万行数据的即时分析。


AI辅助编程,代码自动修复
Trae是一种自适应的集成开发环境(IDE),通过自动化和多元协作改变开发流程。利用Trae,团队能够更快速、精确地编写和部署代码,从而提高编程效率和项目交付速度。Trae具备上下文感知和代码自动完成功能,是提升开发效率的理想工具。


AI论文写作指导平台
AIWritePaper论文写作是一站式AI论文写作辅助工具,简化了选题、文献检索至论文撰写的整个过程。通过简单设定,平台可快速生成高质量论文大纲和全文,配合图表、参考文献等一应俱全,同时提供开题报告和答辩PPT等增值服务,保障数据安全,有效提升写作效率和论文质量。


AI一键生成PPT,就用博思AIPPT!
博思AIPPT,新一代的AI生成PPT平台,支持智能生成PPT、AI美化PPT、文本&链接生成PPT、导入Word/PDF/Markdown文档生成PPT等,内置海量精美PPT模板,涵盖商务、教育、科技等不同风格,同时针对每个页面提供多种版式,一键自适应切换,完美适配各种办公场景。

