Skip to content

contexart/fullPage.js

 
 

Repository files navigation

fullPage.js

preview A simple and easy to use plugin to create fullscreen scrolling websites. (also known as single page websites) It allows to create fullscren scrolling websites as well as adding some landscape sliders inside the sections of the site.

Introduction

The plugin is in its first version and will keep improving with the time. Suggestion will be more than welcome, not only for requisites requests but also for coding improvements.

Let's make of this a great plugin to make the world easier!

Working under all modern browsers as well as old ones such as IE8, Opera 12...

Usage

As you can see in the example.html file, you will need to include the javascript file jquery.fullPage.js and the css file jquery.fullPage.css of the plugin as well as jQuery library (and the jQuery UI library in case you want to use easing effects. (active by default))

###Incuding files:

<link rel="stylesheet" type="text/css" href="jquery.fullPage.css" />

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script>	
	
<script type="text/javascript" src="jquery.fullPage.js"></script>

###Required HTML structure Each section will be defined with a div containing the section class. The active section by default will be the first section, which is taken as the home page.

<div class="section active"> WHATEVER</div>
<div class="section">WHATEVER</div>
<div class="section">WHATEVER</div>
<div class="section">WHATEVER</div>

In order to create a landscape slider within a section, each slide will be difined with another div:

<div class="section active">
	<div class="slide active"> Slide 1 </div>
	<div class="slide"> Slide 2 </div>
	<div class="slide"> Slide  </div>
	<div class="slide"> Slide 4 </div>
</div>

The class active will be requiered to specify which slide is the one to show in the first place.

You can see a full example of the HTML structure in the example.html file.

###Initialization Then, you will only need to call the plugin inside $(document).ready function:

$(document).ready(function() {
	$.fn.fullpage();
});

Options

  • verticalCentered: (default true) Vertically centering of the content within sections.

  • resize: (default true) Whether you want to resize the text when the window is resized.

  • scrollingSpeed: (default 700) Speed in miliseconds for the scrolling transitions.

  • slidesColor:(default none) Define the CSS background-color property for each section: Example:

$.fn.fullpage({
    slidesColor: ['#f2f2f2', '#4BBFC3', '#7BAABE', 'whitesmoke', '#000'],
});
  • easing: (default easeInQuart) Defines the transition effect to use for the vertical scrolling. It requieres jQuery UI library in case of using some of its transitions. Other library could be used instead.

  • menu: (default 'false') A selector can be used to specify the menu to link with the slides. This way the scrolling of the slides will activate the corresponding element in the menu using the class active. This won't generate a menu but just add the active class to the given element (the menu) with the corresponding anchor link. In order to link the elements with the menu with the slides, an HTML 5 data-tag (data-menuanchor) will be needed to use with the same anchor links as used within the sections. Example:

<ul id="myMenu">
    <li data-menuanchor="firstPage" class="active"><a href="#firstPage">First slide</a></li>
    <li data-menuanchor="secondPage" class=""><a href="#secondPage">Second slide</a></li>
    <li data-menuanchor="3rdPage" class=""><a href="#3rdPage">Third slide</a></li>
    <li data-menuanchor="4thpage" class=""><a href="#4thpage">Fourth slide</a></li>
</ul>
$.fn.fullpage({
    anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage', 'lastPage'],
    menu: '#myMenu'
});

Methods

moveSlideUp

Scrolls one slide up:

$.fn.fullpage.moveSlideUp();

moveSlideDown

Scrolls one slide down:

$.fn.fullpage.moveSlideDown();

moveSlideTo

Scrolls the page to the given slide anchor name or to the given index.

/*Scrolling to the section with the anchor link `firstSlide` */
$.fn.fullpage.moveToSlide('#firstSlide');
/*Scrolling to the 3rd section in the site*/
$.fn.fullpage.moveToSlide(3); 

License

(The MIT License)

Copyright (c) 2013 Alvaro Trigo <alvaro@alvarotrigo.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

fullPage plugin by Alvaro Trigo. Create full screen pages fast and simple

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published