├── .gitignore
├── imgs
├── 1.png
├── 2.png
├── 3.png
├── intro.png
├── slider.png
├── example.png
├── example2.png
├── fullPage.png
└── tablets.png
├── examples
├── imgs
│ ├── 1.png
│ ├── 2.png
│ ├── 3.png
│ ├── bg1.jpg
│ ├── bg2.jpg
│ ├── bg3.jpg
│ ├── bg4.jpg
│ ├── bg5.jpg
│ ├── intro.png
│ ├── example.png
│ ├── slider.png
│ ├── tablets.png
│ ├── example2.png
│ ├── fullPage.png
│ └── copyright.txt
├── callback.css
├── simple.css
├── examples.js
├── backgrounds.css
├── simple.html
├── backgrounds.html
├── noAnchor.html
├── looping.html
├── easing.html
├── scrollingSpeed.html
├── callback.html
├── demoPage.css
└── demoPage.html
├── example.css
├── example.html
├── example2.css
├── jquery.fullPage.css
├── vendors
└── jquery.slimscroll.min.js
├── example2.html
├── jquery.fullPage.min.js
├── README.md
└── jquery.fullPage.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/imgs/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/1.png
--------------------------------------------------------------------------------
/imgs/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/2.png
--------------------------------------------------------------------------------
/imgs/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/3.png
--------------------------------------------------------------------------------
/imgs/intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/intro.png
--------------------------------------------------------------------------------
/imgs/slider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/slider.png
--------------------------------------------------------------------------------
/imgs/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/example.png
--------------------------------------------------------------------------------
/imgs/example2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/example2.png
--------------------------------------------------------------------------------
/imgs/fullPage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/fullPage.png
--------------------------------------------------------------------------------
/imgs/tablets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/imgs/tablets.png
--------------------------------------------------------------------------------
/examples/imgs/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/1.png
--------------------------------------------------------------------------------
/examples/imgs/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/2.png
--------------------------------------------------------------------------------
/examples/imgs/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/3.png
--------------------------------------------------------------------------------
/examples/imgs/bg1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/bg1.jpg
--------------------------------------------------------------------------------
/examples/imgs/bg2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/bg2.jpg
--------------------------------------------------------------------------------
/examples/imgs/bg3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/bg3.jpg
--------------------------------------------------------------------------------
/examples/imgs/bg4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/bg4.jpg
--------------------------------------------------------------------------------
/examples/imgs/bg5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/bg5.jpg
--------------------------------------------------------------------------------
/examples/imgs/intro.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/intro.png
--------------------------------------------------------------------------------
/examples/imgs/example.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/example.png
--------------------------------------------------------------------------------
/examples/imgs/slider.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/slider.png
--------------------------------------------------------------------------------
/examples/imgs/tablets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/tablets.png
--------------------------------------------------------------------------------
/examples/imgs/example2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/example2.png
--------------------------------------------------------------------------------
/examples/imgs/fullPage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/iheanyi/fullPage.js/master/examples/imgs/fullPage.png
--------------------------------------------------------------------------------
/examples/callback.css:
--------------------------------------------------------------------------------
1 | #section1 img{
2 | left: 130%;
3 | position:relative;
4 | }
5 | #section1 p{
6 | visibility:hidden;
7 | }
8 | #section2 .intro{
9 | left: -130%;
10 | position:relative;
11 | }
12 |
--------------------------------------------------------------------------------
/example.css:
--------------------------------------------------------------------------------
1 | .wrap{
2 | margin-left: auto;
3 | margin-right: auto;
4 | width: 960px;
5 | position: relative;
6 | }
7 | h1{
8 | font-size: 5em;
9 | font-family: arial,helvetica;
10 | }
11 | .section{
12 | text-align:center;
13 | }
14 |
--------------------------------------------------------------------------------
/examples/imgs/copyright.txt:
--------------------------------------------------------------------------------
1 | Background images used in the examples were extracted from:
2 |
3 | http://good-wallpapers.com/art/4121
4 | http://files.all-free-download.com/downloadfiles/wallpapers/1920_1200_widescreen/old_farm_wallpaper_landscape_nature_wallpaper_1920_1200_widescreen_1439.jpg
5 | http://www.hdwallpaperstop.com/wp-content/uploads/2013/05/Beautiful-Landscape-Pictures-of-nature.jpg
6 | http://duggal.com/connect/wp-content/uploads/2013/06/Landscape-Nature-for-Wallpaper-Dekstop-.jpg
7 | http://www.imgbase.info/images/safe-wallpapers/digital_art/3d_landscape/9659_3d_landscape.jpg
--------------------------------------------------------------------------------
/examples/simple.css:
--------------------------------------------------------------------------------
1 | .wrap{
2 | margin-left: auto;
3 | margin-right: auto;
4 | width: 960px;
5 | position: relative;
6 | }
7 | h1{
8 | font-size: 5em;
9 | font-family: arial,helvetica;
10 | }
11 | .section{
12 | text-align:center;
13 | }
14 | ul li{
15 | display:inline-block;
16 | padding: 20px;
17 | color: #ccc;
18 | }
19 | ul li.active{
20 | color: #000;
21 | }
22 | ul{
23 | position:fixed;
24 | top:0;
25 | left:0;
26 | height: 40px;
27 | background: #fff;
28 | z-index: 9999;
29 | width: 100%;
30 | padding: 0;
31 | margin:0;
32 | }
33 |
34 |
--------------------------------------------------------------------------------
/examples/examples.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function(){
2 |
3 | $("#demosMenu").change(function(){
4 | var id = $(this).find("option:selected").attr("id");
5 |
6 | switch (id){
7 | case 'background':
8 | window.location.href = 'backgrounds.html';
9 | break;
10 |
11 | case 'looping':
12 | window.location.href = 'looping.html';
13 | break;
14 |
15 | case 'noAnchor':
16 | window.location.href = 'noAnchor.html';
17 | break;
18 |
19 | case 'scrollingSpeed':
20 | window.location.href = 'scrollingSpeed.html';
21 | break;
22 |
23 | case 'easing':
24 | window.location.href = 'easing.html';
25 | break;
26 |
27 | case 'callbacks':
28 | window.location.href = 'callback.html';
29 | break;
30 | }
31 | });
32 |
33 | });
--------------------------------------------------------------------------------
/examples/backgrounds.css:
--------------------------------------------------------------------------------
1 | h1{
2 | font-size: 5em;
3 | font-family: arial,helvetica;
4 | color: #fff;
5 | margin:0;
6 | padding:0;
7 | }
8 | .section{
9 | text-align:center;
10 | }
11 |
12 | /* Menu
13 | * --------------------------------------- */
14 | ul li{
15 | display:inline-block;
16 | padding: 20px;
17 | color: #ccc;
18 | }
19 | ul li.active{
20 | color: #000;
21 | }
22 | ul{
23 | position:fixed;
24 | top:0;
25 | left:0;
26 | height: 40px;
27 | background: #fff;
28 | z-index: 9999;
29 | width: 100%;
30 | padding: 0;
31 | margin:0;
32 | }
33 |
34 | /* Demos Menu
35 | * --------------------------------------- */
36 | #demosMenu{
37 | position:fixed;
38 | bottom: 10px;
39 | right:10px;
40 | z-index: 999;
41 | }
42 |
43 | /* Sections
44 | * --------------------------------------- */
45 | #section0,
46 | #section1,
47 | #section2,
48 | #section3{
49 | background-size: cover;
50 | }
51 | #section0{
52 | background-image: url(imgs/bg1.jpg);
53 | padding: 30% 0 0 0;
54 | }
55 |
56 | /*Creatin a ull height slide */
57 | .slides{
58 | height: 100%;
59 | display:block;
60 | }
61 | #slide1{
62 | background-image: url(imgs/bg2.jpg);
63 | padding: 6% 0 0 0;
64 | height: 100%;
65 | display:block;
66 | }
67 | #slide2{
68 | background-image: url(imgs/bg5.jpg);
69 | padding: 6% 0 0 0;
70 | height: 100%;
71 | }
72 | #section2{
73 | background-image: url(imgs/bg3.jpg);
74 | padding: 6% 0 0 0;
75 | }
76 | #section3{
77 | background-image: url(imgs/bg4.jpg);
78 | padding: 6% 0 0 0;
79 | }
80 | #section3 h1{
81 | color:#000;
82 | }
--------------------------------------------------------------------------------
/examples/simple.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | fullPage.js A simple Demo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
33 |
34 |
35 |
36 |
37 |
fullPage.js
38 |
39 |
Simple Demo
40 |
Only text
41 |
And text
42 |
And more text
43 |
44 |
No wraps, no extra markup
45 |
Just the simplest demo ever
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/example.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | fullPage.js plugin by Alvaro Trigo
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
34 |
35 |
36 |
37 |
38 |
Section
39 |
40 |
41 |
This is an awesome plugin
42 |
Which enables you to create awesome websites
43 |
In the most simple way ever
44 |
45 |
Just testing it
46 |
Looks good
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/examples/backgrounds.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | FullScrren Backgrounds - fullPage.js
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
35 |
36 |
37 |
38 |
39 |
48 |
49 |
fullPage.js
50 |
51 |
Slide Backgrounds
52 |
Totally customizable
53 |
54 |
Lovely images for a lovely page
55 |
One Image = One thousand words
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/examples/noAnchor.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | No Anchor Links - fullPage.js
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
34 |
35 |
36 |
37 |
38 |
39 |
48 |
49 |
50 |
51 |
fullPage.js
52 |
No Anchor Links (#)
53 |
54 |
55 |
56 |
57 |
More Simple yet
58 |
Sections won't contain anchor links. It's more simple to configure but a bit more restrictive.
59 |
60 |
61 |
62 |
63 |
64 |
URL without /#
65 |
But back button won't work!
66 |
67 |
68 |
69 |
70 |
71 |
72 |
--------------------------------------------------------------------------------
/examples/looping.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Looping scroll - fullPage.js
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
38 |
39 |
40 |
41 |
42 |
43 |
52 |
53 |
54 |
59 |
60 |
61 |
fullPage.js
62 |
Looping Top and Bottom Enabled
63 |
64 |
65 |
66 |
67 |
Looping!
68 |
Go to the first section and scroll up or to the last one and scroll down to see how it works.
69 |
70 |
71 |
72 |
73 |
74 |
Scroll Down
75 |
And it will loop to the first section
76 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/examples/easing.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Easing effect - fullPage.js
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
38 |
39 |
40 |
41 |
42 |
43 |
52 |
53 |
54 |
59 |
60 |
61 |
fullPage.js
62 |
Configure the easing jQuery UI effect!
63 |
64 |
65 |
66 |
67 |
68 |
easeOutExpo
69 |
This example is working with `easeOutExpo` effect instead of the default `easeOutExpo`
70 |
You can see more about them here
71 |
72 |
73 |
74 |
75 |
Cool uh?
76 |
Choose the best easing effect for your site!
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
--------------------------------------------------------------------------------
/examples/scrollingSpeed.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Scrolling Speed - fullPage.js
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
38 |
39 |
40 |
41 |
42 |
43 |
52 |
53 |
54 |
59 |
60 |
61 |
fullPage.js
62 |
Configure the scrolling speed!
63 |
64 |
65 |
66 |
67 |
68 |
69 |
Slow scrolling speed
70 |
In case we want to make a site for old people, for example :)
71 |
72 |
73 |
74 |
75 |
76 |
Landscape too
77 |
Also applied to landscape slides. Great uh?
78 |
79 |
80 |
81 |
82 |
83 |
Slooooooww
84 |
Now you can try other demos!
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/example2.css:
--------------------------------------------------------------------------------
1 | @CHARSET "ISO-8859-1";
2 | /* Reset CSS
3 | * --------------------------------------- */
4 | body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
5 | form,fieldset,input,textarea,p,blockquote,th,td {
6 | padding: 0;
7 | margin: 0;
8 | }
9 | a{
10 | text-decoration:none;
11 | }
12 | table {
13 | border-spacing: 0;
14 | }
15 | fieldset,img {
16 | border: 0;
17 | }
18 | address,caption,cite,code,dfn,em,strong,th,var {
19 | font-weight: normal;
20 | font-style: normal;
21 | }
22 | strong{
23 | font-weight: bold;
24 | }
25 | ol,ul {
26 | list-style: none;
27 | margin:0;
28 | padding:0;
29 | }
30 | caption,th {
31 | text-align: left;
32 |
33 | }
34 | h1,h2,h3,h4,h5,h6 {
35 | font-weight: normal;
36 | font-size: 100%;
37 | margin:0;
38 | padding:0;
39 | color:#444;
40 | }
41 | q:before,q:after {
42 | content:'';
43 | }
44 | abbr,acronym { border: 0;
45 | }
46 |
47 |
48 | /* Custom CSS
49 | * --------------------------------------- */
50 | body{
51 | font-family: arial,helvetica;
52 | color: #333;
53 | color: rgba(0,0,0,0.5);
54 | }
55 | .wrap{
56 | margin-left: auto;
57 | margin-right: auto;
58 | width: 960px;
59 | position: relative;
60 | }
61 | h1{
62 | font-size: 6em;
63 | }
64 | p{
65 | font-size: 2em;
66 | }
67 | .section{
68 | text-align:center;
69 | }
70 | #menu li {
71 | display:inline-block;
72 | margin: 10px;
73 | color: #000;
74 | background:#fff;
75 | background: rgba(255,255,255, 0.5);
76 | -webkit-border-radius: 10px;
77 | border-radius: 10px;
78 | }
79 | #menu li.active{
80 | background:#666;
81 | background: rgba(0,0,0, 0.5);
82 | color: #fff;
83 | }
84 | #menu li a{
85 | text-decoration:none;
86 | color: #000;
87 | }
88 | #menu li.active a:hover{
89 | color: #000;
90 | }
91 | #menu li:hover{
92 | background: rgba(255,255,255, 0.8);
93 | }
94 | #menu li a,
95 | #menu li.active a{
96 | padding: 9px 18px;
97 | display:block;
98 | }
99 | #menu li.active a{
100 | color: #fff;
101 | }
102 | #menu{
103 | position:fixed;
104 | top:0;
105 | left:0;
106 | height: 40px;
107 | z-index: 70;
108 | width: 100%;
109 | padding: 0;
110 | margin:0;
111 | }
112 | #section0 img,
113 | #section1 img{
114 | margin: 20px 0 0 0;
115 | }
116 | #section2 img{
117 | margin: 20px 0 0 52px;
118 | }
119 | #section3 img{
120 | bottom: 0px;
121 | position:absolute;
122 | margin-left: -420px;
123 | }
124 | .intro p{
125 | width: 50%;
126 | margin: 0 auto;
127 | font-size: 1.5em;
128 | }
129 | .twitter-share-button{
130 | position: absolute;
131 | z-index: 99;
132 | right: 149px;
133 | top: 9px;
134 | }
135 | #fullPage-nav{
136 | position: absolute;
137 | z-index: 100;
138 | margin-top: -32px;
139 | top: 50%;
140 | opacity: 1;
141 | }
142 | #fullPage-nav li{
143 | display: block;
144 | width: 14px;
145 | height: 13px;
146 | margin: 7px;
147 | }
148 | #fullPage-nav li a{
149 | display: block;
150 | position: relative;
151 | z-index: 1;
152 | width: 100%;
153 | height: 100%;
154 | cursor: pointer;
155 | text-decoration: none;
156 | }
157 | #fullPage-nav li .active span{
158 | background: #333;
159 | }
160 | #fullPage-nav span{
161 | top: 2px;
162 | left: 2px;
163 | width: 8px;
164 | height: 8px;
165 | border: 1px solid #000;
166 | background: rgba(0, 0, 0, 0);
167 | -webkit-border-radius: 50%;
168 | -moz-border-radius: 50%;
169 | border-radius: 50%;
170 | position: absolute;
171 | z-index: 1;
172 | }
--------------------------------------------------------------------------------
/jquery.fullPage.css:
--------------------------------------------------------------------------------
1 | /**
2 | * fullPage 1.4.5
3 | * https://github.com/alvarotrigo/fullPage.js
4 | * MIT licensed
5 | *
6 | * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
7 | */
8 | body, html {
9 | margin:0;
10 | padding:0;
11 | }
12 | #superContainer {
13 | height:100%;
14 | position:relative;
15 | }
16 | .section{
17 | position: relative;
18 | -webkit-box-sizing: border-box;
19 | -moz-box-sizing: border-box;
20 | box-sizing: border-box;
21 | }
22 | .slide {
23 | float: left;
24 | }
25 | .slide, .slidesContainer {
26 | height: 100%;
27 | display: block;
28 | }
29 | .slides {
30 | height: 100%;
31 | overflow: hidden;
32 | position: relative;
33 | -webkit-transition: all 0.3s ease-out;
34 | -moz-transition: all 0.3s ease-out;
35 | -o-transition: all 0.3s ease-out;
36 | transition: all 0.3s ease-out;
37 | }
38 | .section.table,
39 | .slide.table{
40 | display:table;
41 | width:100%;
42 | }
43 | .tableCell{
44 | display:table-cell;
45 | vertical-align: middle;
46 | width:100%;
47 | height: 100%;
48 | }
49 | .slidesContainer {
50 | float: left;
51 | position: relative;
52 | }
53 | .controlArrow{
54 | position:absolute;
55 | top:50%;
56 | cursor:pointer;
57 | width: 0px;
58 | height: 0px;
59 | border-style: solid;
60 | margin-top: -38px;
61 | }
62 |
63 | .controlArrow.prev{
64 | left:15px;
65 | width: 0px;
66 | border-width: 38.5px 34px 38.5px 0;
67 | border-color: transparent #fff transparent transparent;
68 | }
69 | .controlArrow.next{
70 | right:15px;
71 | border-width: 38.5px 0 38.5px 34px;
72 | border-color: transparent transparent transparent #fff;
73 | }
74 | .scrollable{
75 | overflow:scroll;
76 | }
77 | .easing{
78 | -webkit-transition: all 0.7s ease-out;
79 | -moz-transition: all 0.7s ease-out;
80 | -o-transition: all 0.7s ease-out;
81 | transition: all 0.7s ease-out;
82 | }
83 | #fullPage-nav{
84 | position: fixed;
85 | z-index: 100;
86 | margin-top: -32px;
87 | top: 50%;
88 | opacity: 1;
89 | }
90 | #fullPage-nav.right{
91 | right: 17px;
92 | }
93 | #fullPage-nav.left{
94 | left: 17px;
95 | }
96 | .fullPage-slidesNav{
97 | position: absolute;
98 | z-index: 4;
99 | left: 50%;
100 | opacity: 1;
101 | }
102 | .fullPage-slidesNav.bottom{
103 | bottom: 17px;
104 | }
105 | .fullPage-slidesNav.top{
106 | top: 17px;
107 | }
108 | #fullPage-nav ul,
109 | .fullPage-slidesNav ul{
110 | margin:0;
111 | padding:0;
112 | }
113 | #fullPage-nav li,
114 | .fullPage-slidesNav li{
115 | display: block;
116 | width: 14px;
117 | height: 13px;
118 | margin: 7px;
119 | position:relative;
120 | }
121 | .fullPage-slidesNav li{
122 | display: inline-block;
123 | }
124 | #fullPage-nav li a,
125 | .fullPage-slidesNav li a{
126 | display: block;
127 | position: relative;
128 | z-index: 1;
129 | width: 100%;
130 | height: 100%;
131 | cursor: pointer;
132 | text-decoration: none;
133 | }
134 | #fullPage-nav li .active span,
135 | .fullPage-slidesNav .active span{
136 | background: #333;
137 | }
138 | #fullPage-nav span,
139 | .fullPage-slidesNav span{
140 | top: 2px;
141 | left: 2px;
142 | width: 8px;
143 | height: 8px;
144 | border: 1px solid #000;
145 | background: rgba(0, 0, 0, 0);
146 | -webkit-border-radius: 50%;
147 | -moz-border-radius: 50%;
148 | border-radius: 50%;
149 | position: absolute;
150 | z-index: 1;
151 | }
152 | .fullPage-tooltip{
153 | position: absolute;
154 | color: #fff;
155 | font-size: 14px;
156 | font-family: arial, helvetica, sans-serif;
157 | top: -2px;
158 | }
159 | .fullPage-tooltip.right{
160 | right: 20px;
161 | }
162 | .fullPage-tooltip.left{
163 | left: 20px;
164 | }
--------------------------------------------------------------------------------
/examples/callback.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Callback function - fullPage.js
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
61 |
62 |
63 |
64 |
65 |
66 |
75 |
76 |
77 |
82 |
83 |
84 |
fullPage.js
85 |
Configure the easing jQuery UI effect!
86 |
87 |
88 |
89 |
90 |
91 |
easeOutExpo
92 |
This example is working with `easeOutExpo` effect instead of the default `easeOutExpo`
93 |
You can see more about them here
94 |
95 |
96 |
97 |
98 |
Cool uh?
99 |
Choose the best easing effect for your site!
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
--------------------------------------------------------------------------------
/vendors/jquery.slimscroll.min.js:
--------------------------------------------------------------------------------
1 | /*! Copyright (c) 2011 Piotr Rochala (http://rocha.la)
2 | * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
3 | * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
4 | *
5 | * Version: 1.1.0
6 | *
7 | */
8 | (function(f){jQuery.fn.extend({slimScroll:function(l){var a=f.extend({width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:0.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:0.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200},l);this.each(function(){function r(d){if(n){d=d||window.event;var c=0;d.wheelDelta&&(c=-d.wheelDelta/
9 | 120);d.detail&&(c=d.detail/3);f(d.target||d.srcTarget).closest("."+a.wrapperClass).is(b.parent())&&g(c,!0);d.preventDefault&&!p&&d.preventDefault();p||(d.returnValue=!1)}}function g(d,f,h){var e=d,g=b.outerHeight()-c.outerHeight();f&&(e=parseInt(c.css("top"))+d*parseInt(a.wheelStep)/100*c.outerHeight(),e=Math.min(Math.max(e,0),g),e=0=b.outerHeight()?p=!0:(c.stop(!0,!0).fadeIn("fast"),a.railVisible&&h.stop(!0,!0).fadeIn("fast"))}function m(){a.alwaysVisible||(w=setTimeout(function(){if((!a.disableFadeOut||!n)&&!u&&!v)c.fadeOut("slow"),h.fadeOut("slow")},1E3))}var n,u,v,w,y,q,j,x,B=30,p=!1,b=f(this);if(b.parent().hasClass(a.wrapperClass)){var k=b.scrollTop(),c=b.parent().find("."+a.barClass),h=b.parent().find("."+a.railClass);t();if(f.isPlainObject(l)){if("scrollTo"in l)k=
12 | parseInt(a.scrollTo);else if("scrollBy"in l)k+=parseInt(a.scrollBy);else if("destroy"in l){c.remove();h.remove();b.unwrap();return}g(k,!1,!0)}}else{a.height="auto"==a.height?b.parent().innerHeight():a.height;k=f("
").addClass(a.wrapperClass).css({position:"relative",overflow:"hidden",width:a.width,height:a.height});b.css({overflow:"hidden",width:a.width,height:a.height});var h=f("
").addClass(a.railClass).css({width:a.size,height:"100%",position:"absolute",top:0,display:a.alwaysVisible&&
13 | a.railVisible?"block":"none","border-radius":a.size,background:a.railColor,opacity:a.railOpacity,zIndex:90}),c=f("
").addClass(a.barClass).css({background:a.color,width:a.size,position:"absolute",top:0,opacity:a.opacity,display:a.alwaysVisible?"block":"none","border-radius":a.size,BorderRadius:a.size,MozBorderRadius:a.size,WebkitBorderRadius:a.size,zIndex:99}),z="right"==a.position?{right:a.distance}:{left:a.distance};h.css(z);c.css(z);b.wrap(k);b.parent().append(c);b.parent().append(h);
14 | a.railDraggable&&c.draggable({axis:"y",containment:"parent",start:function(){v=!0},stop:function(){v=!1;m()},drag:function(){g(0,f(this).position().top,!1)}});h.hover(function(){s()},function(){m()});c.hover(function(){u=!0},function(){u=!1});b.hover(function(){n=!0;s();m()},function(){n=!1;m()});b.bind("touchstart",function(a){a.originalEvent.touches.length&&(y=a.originalEvent.touches[0].pageY)});b.bind("touchmove",function(b){b.originalEvent.preventDefault();b.originalEvent.touches.length&&g((y-
15 | b.originalEvent.touches[0].pageY)/a.touchScrollStep,!0)});"bottom"===a.start?(c.css({top:b.outerHeight()-c.outerHeight()}),g(0,!0)):"top"!==a.start&&(g(f(a.start).position().top,null,!0),a.alwaysVisible||c.hide());A();t()}});return this}});jQuery.fn.extend({slimscroll:jQuery.fn.slimScroll})})(jQuery);
--------------------------------------------------------------------------------
/examples/demoPage.css:
--------------------------------------------------------------------------------
1 | @CHARSET "ISO-8859-1";
2 | /* Reset CSS
3 | * --------------------------------------- */
4 | body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,
5 | form,fieldset,input,textarea,p,blockquote,th,td {
6 | padding: 0;
7 | margin: 0;
8 | }
9 | a{
10 | text-decoration:none;
11 | }
12 | table {
13 | border-spacing: 0;
14 | }
15 | fieldset,img {
16 | border: 0;
17 | }
18 | address,caption,cite,code,dfn,em,strong,th,var {
19 | font-weight: normal;
20 | font-style: normal;
21 | }
22 | strong{
23 | font-weight: bold;
24 | }
25 | ol,ul {
26 | list-style: none;
27 | margin:0;
28 | padding:0;
29 | }
30 | caption,th {
31 | text-align: left;
32 |
33 | }
34 | h1,h2,h3,h4,h5,h6 {
35 | font-weight: normal;
36 | font-size: 100%;
37 | margin:0;
38 | padding:0;
39 | color:#444;
40 | }
41 | q:before,q:after {
42 | content:'';
43 | }
44 | abbr,acronym { border: 0;
45 | }
46 |
47 |
48 | /* Custom CSS
49 | * --------------------------------------- */
50 | body{
51 | font-family: arial,helvetica;
52 | color: #333;
53 | color: rgba(0,0,0,0.5);
54 | }
55 | .wrap{
56 | margin-left: auto;
57 | margin-right: auto;
58 | width: 960px;
59 | position: relative;
60 | }
61 | h1{
62 | font-size: 6em;
63 | }
64 | p{
65 | font-size: 2em;
66 | }
67 | .section{
68 | text-align:center;
69 | }
70 |
71 | /* Menu
72 | * --------------------------------------- */
73 | #menu{
74 | position:fixed;
75 | top:0;
76 | left:0;
77 | height: 40px;
78 | z-index: 70;
79 | width: 100%;
80 | padding: 0;
81 | margin:0;
82 | }
83 | #menu li {
84 | display:inline-block;
85 | margin: 10px;
86 | color: #000;
87 | background:#fff;
88 | background: rgba(255,255,255, 0.5);
89 | -webkit-border-radius: 10px;
90 | border-radius: 10px;
91 | }
92 | #menu li.active{
93 | background:#666;
94 | background: rgba(0,0,0, 0.5);
95 | color: #fff;
96 | }
97 | #menu li a{
98 | text-decoration:none;
99 | color: #000;
100 | }
101 | #menu li.active a:hover{
102 | color: #000;
103 | }
104 | #menu li:hover{
105 | background: rgba(255,255,255, 0.8);
106 | }
107 | #menu li a,
108 | #menu li.active a{
109 | padding: 9px 18px;
110 | display:block;
111 | }
112 | #menu li.active a{
113 | color: #fff;
114 | }
115 |
116 | /* Demos Menu
117 | * --------------------------------------- */
118 | #demosMenu{
119 | position:fixed;
120 | bottom: 10px;
121 | right:10px;
122 | z-index: 999;
123 | }
124 |
125 |
126 | /* Sections
127 | * --------------------------------------- */
128 | #section0 img,
129 | #section1 img{
130 | margin: 20px 0 0 0;
131 | }
132 | #section2 img{
133 | margin: 20px 0 0 52px;
134 | }
135 | #section3 img{
136 | bottom: 0px;
137 | margin:auto;
138 | display:block;
139 | }
140 | .intro p{
141 | width: 50%;
142 | margin: 0 auto;
143 | font-size: 1.5em;
144 | }
145 | .twitter-share-button{
146 | position: absolute;
147 | z-index: 99;
148 | right: 149px;
149 | top: 9px;
150 | }
151 |
152 | /* Navigation
153 | * --------------------------------------- */
154 | #fullPage-nav{
155 | position: absolute;
156 | z-index: 100;
157 | margin-top: -32px;
158 | top: 50%;
159 | opacity: 1;
160 | }
161 | #fullPage-nav li{
162 | display: block;
163 | width: 14px;
164 | height: 13px;
165 | margin: 7px;
166 | }
167 | #fullPage-nav li a{
168 | display: block;
169 | position: relative;
170 | z-index: 1;
171 | width: 100%;
172 | height: 100%;
173 | cursor: pointer;
174 | text-decoration: none;
175 | }
176 | #fullPage-nav li .active span{
177 | background: #333;
178 | }
179 | #fullPage-nav span{
180 | top: 2px;
181 | left: 2px;
182 | width: 8px;
183 | height: 8px;
184 | border: 1px solid #000;
185 | background: rgba(0, 0, 0, 0);
186 | -webkit-border-radius: 50%;
187 | -moz-border-radius: 50%;
188 | border-radius: 50%;
189 | position: absolute;
190 | z-index: 1;
191 | }
--------------------------------------------------------------------------------
/examples/demoPage.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | fullPage.js One Page Scroll Sites
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
37 |
38 |
39 |
40 |
41 |
42 |
51 |
52 |
53 |
59 |
60 |
61 |
fullPage.js
62 |
Create Beautiful Fullscreen Scrolling Websites
63 |
64 |
65 |
66 |
67 |
68 |
Create Sliders
69 |
Not only vertical scrolling but also horizontal scrolling. With fullPage.js you will be able to add horizontal sliders in the most simple way ever.
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
Simple
78 |
Easy to use. Configurable and customizable.
79 |
80 |
81 |
82 |
83 |
84 |
Cool
85 |
It just looks cool. Impress everybody with a simple and modern web design!
86 |
87 |
88 |
89 |
90 |
91 |
Compatible
92 |
Working in modern and old browsers too! IE 8 users don't have the fault of using that horrible browser! Lets give them a chance to see your site in a proper way!
93 |
94 |
95 |
96 |
97 |
98 |
Example
99 |
HTML markup example to define 4 sections.
100 |
101 |
102 |
103 |
104 |
105 |
Working On Tablets
106 |
107 | Designed to fit to different screen sizes as well as tablet and mobile devices.
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/example2.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | fullPage.js One Page Scroll Sites
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
21 |
22 |
23 |
24 |
25 |
26 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
50 |
51 |
52 |
fullPage.js
53 |
Create Beautiful Fullscreen Scrolling Websites
54 |
55 |
56 |
57 |
58 |
59 |
Create Sliders
60 |
Not only vertical scrolling but also horizontal scrolling. With fullPage.js you will be able to add horizontal sliders in the most simple way ever.
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
Simple
69 |
Easy to use. Configurable and customizable.
70 |
71 |
72 |
73 |
74 |
75 |
Cool
76 |
It just looks cool. Impress everybody with a simple and modern web design!
77 |
78 |
79 |
80 |
81 |
82 |
Compatible
83 |
Working in modern and old browsers too! IE 8 users don't have the fault of using that horrible browser! Lets give them a chance to see your site in a proper way!
84 |
85 |
86 |
87 |
88 |
89 |
Example
90 |
HTML markup example to define 4 sections.
91 |
92 |
93 |
94 |
95 |
96 |
Working On Tablets
97 |
98 | Designed to fit to different screen sizes as well as tablet and mobile devices.
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
--------------------------------------------------------------------------------
/jquery.fullPage.min.js:
--------------------------------------------------------------------------------
1 | /**
2 | * fullPage 1.4.6
3 | * https://github.com/alvarotrigo/fullPage.js
4 | * MIT licensed
5 | *
6 | * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
7 | */
8 | (function(b){b.fn.fullpage=function(c){function h(a){if(c.autoScrolling){a=window.event||a;a=Math.max(-1,Math.min(1,a.wheelDelta||-a.detail));var e;e=b(".section.active");if(!l)if(e=e.find(".slides").length?e.find(".slide.active").find(".scrollable"):e.find(".scrollable"),0>a)if(0a||900>e?(900>e&&(f=e,c=900),c=(100*f/c).toFixed(2),b("body").css("font-size",c+"%")):b("body").css("font-size","100%")}function H(a,e){c.navigation&&(b("#fullPage-nav").find(".active").removeClass("active"),a?b("#fullPage-nav").find('a[href="#'+a+'"]').addClass("active"):b("#fullPage-nav").find("li").eq(e).find("a").addClass("active"))}function G(a){c.menu&&(b(c.menu).find(".active").removeClass("active"),b(c.menu).find('[data-menuanchor="'+
15 | a+'"]').addClass("active"))}function s(a,b){if("top"===a)return!b.scrollTop();if("bottom"===a)return b.scrollTop()+b.innerHeight()>=b[0].scrollHeight}function E(a){var c=b(".section.active").index(".section");a=a.index(".section");return c>a?"up":"down"}function u(a){a.css("overflow","hidden");var b=a.closest(".section"),d=a.find(".scrollable");(d.length?a.find(".scrollable").get(0).scrollHeight-parseInt(b.css("padding-bottom"))-parseInt(b.css("padding-top")):a.get(0).scrollHeight-parseInt(b.css("padding-bottom"))-
16 | parseInt(b.css("padding-top")))>g?(b=g-parseInt(b.css("padding-bottom"))-parseInt(b.css("padding-top")),d.length?d.css("height",b+"px").parent().css("height",b+"px"):(c.verticalCentered?a.find(".tableCell").wrapInner('
'):a.wrapInner('
'),a.find(".scrollable").slimScroll({height:b+"px",size:"10px",alwaysVisible:!0}))):(a.find(".scrollable").children().first().unwrap().unwrap(),a.find(".slimScrollBar").remove(),a.find(".slimScrollRail").remove());a.css("overflow",
17 | "")}function J(a){a.addClass("table").wrapInner('
')}function y(a,c){b("#superContainer").toggleClass("easing",c);b("#superContainer").css({"-webkit-transform":a,"-moz-transform":a,"-ms-transform":a,transform:a})}function K(a,c){var d=b('[data-anchor="'+a+'"]');a!==t?k(d,function(){L(d,c)}):L(d,c)}function L(a,b){if("undefined"!=typeof b){var c=a.find(".slides"),f=c.find('[data-anchor="'+b+'"]');f.length||(f=c.find(".slide").eq(b));q(c,f)}}function P(a,
18 | b){a.append('');var d=a.find(".fullPage-slidesNav");d.addClass(c.slidesNavPosition);for(var f=0;f ');d.css("margin-left","-"+d.width()/2+"px");d.find("li").first().find("a").addClass("active")}function Q(){var a=document.createElement("p"),b,c={webkitTransform:"-webkit-transform",OTransform:"-o-transform",msTransform:"-ms-transform",MozTransform:"-moz-transform",transform:"transform"};document.body.insertBefore(a,
19 | null);for(var f in c)void 0!==a.style[f]&&(a.style[f]="translate3d(1px,1px,1px)",b=window.getComputedStyle(a).getPropertyValue(c[f]));document.body.removeChild(a);return void 0!==b&&0 ');if(c.navigation){b("body").append('');var p=b("#fullPage-nav");p.css("color",c.navigationColor);
22 | p.addClass(c.navigationPosition)}b(".section").each(function(a){var e=b(this).find(".slide"),d=e.length;a||b(this).addClass("active");b(this).css("height",g+"px");(c.paddingTop||c.paddingBottom)&&b(this).css("padding",c.paddingTop+" 0 "+c.paddingBottom+" 0");"undefined"!==typeof c.slidesColor[a]&&b(this).css("background-color",c.slidesColor[a]);"undefined"!==typeof c.anchors[a]&&b(this).attr("data-anchor",c.anchors[a]);if(c.navigation){var f="";c.anchors.length&&(f=c.anchors[a]);a=c.navigationTooltips[a];
23 | "undefined"===typeof a&&(a="");p.find("ul").append(' ')}if(0 ');e.parent().wrap('
');b(this).find(".slidesContainer").css("width",f+"%");b(this).find(".slides").after('
');b(this).find(".controlArrow.next").css("border-color","transparent transparent transparent "+c.controlArrowColor);
24 | b(this).find(".controlArrow.prev").css("border-color","transparent "+c.controlArrowColor+" transparent transparent");c.loopHorizontal||b(this).find(".controlArrow.prev").hide();c.slidesNavigation&&P(b(this),d);e.each(function(a){a||b(this).addClass("active");b(this).css("width",h+"%");c.verticalCentered&&J(b(this))})}else c.verticalCentered&&J(b(this))}).promise().done(function(){b.fn.fullpage.setAutoScrolling(c.autoScrolling);b.isFunction(c.afterRender)&&c.afterRender.call(this);c.fixedElements&&
25 | c.css3&&b(c.fixedElements).appendTo("body");c.navigation&&(p.css("margin-top","-"+p.height()/2+"px"),p.find("li").first().find("a").addClass("active"));c.menu&&c.css3&&b(c.menu).appendTo("body");if(c.scrollOverflow)b(window).on("load",function(){b(".section").each(function(){var a=b(this).find(".slide");a.length?a.each(function(){u(b(this))}):u(b(this))})});b(window).on("load",function(){var a=window.location.hash.replace("#","").split("/"),b=a[0],a=a[1];b&&K(b,a)})});var M,A=!1;b(window).scroll(function(a){if(!c.autoScrolling){var e=
26 | b(window).scrollTop();a=b(".section").map(function(){if(b(this).offset().topMath.abs(B-C))v>w?b(".section.active").find(".controlArrow.next").trigger("click"):vC)if(0'+a+"").hide().appendTo(b(this)).fadeIn(200)},mouseleave:function(){b(this).find(".fullPage-tooltip").fadeOut().remove()}},
31 | "#fullPage-nav li");c.normalScrollElements&&(b(document).on("mouseover",c.normalScrollElements,function(){document.addEventListener?(document.removeEventListener("mousewheel",h,!1),document.removeEventListener("DOMMouseScroll",h,!1)):document.detachEvent("onmousewheel",h)}),b(document).on("mouseout",c.normalScrollElements,function(){D()}));b(".section").on("click",".controlArrow",function(){if(!r){r=!0;var a=b(this).closest(".section").find(".slides"),c=a.find(".slide.active"),d=null,d=b(this).hasClass("prev")?
32 | c.prev(".slide"):c.next(".slide");d.length||(d=b(this).hasClass("prev")?c.siblings(":last"):c.siblings(":first"));q(a,d)}});b(".section").on("click",".toSlide",function(a){a.preventDefault();a=b(this).closest(".section").find(".slides");a.find(".slide.active");var c=null,c=a.find(".slide").eq(b(this).data("index")-1);0
27 |
28 |
29 |
30 |
31 |
33 |
34 |
35 | ```
36 |
37 | ###Required HTML structure
38 | Each section will be defined with a `div` containing the `section` class.
39 | The active section by default will be the first section, which is taken as the home page.
40 | ```html
41 | Some section
42 | Some section
43 | Some section
44 | Some section
45 | ```
46 |
47 | In order to create a landscape slider within a section, each slide will be defined with another `div`:
48 | ```html
49 |
50 |
Slide 1
51 |
Slide 2
52 |
Slide 3
53 |
Slide 4
54 |
55 | ````
56 | You can see a fully working example of the HTML structure in the [`example.html` file](https://github.com/alvarotrigo/fullPage.js/blob/master/example.html).
57 |
58 | ###Initialization
59 | All you need to do is call the plugin inside a `$(document).ready` function:
60 |
61 | ```javascript
62 | $(document).ready(function() {
63 | $.fn.fullpage();
64 | });
65 | ```
66 |
67 | A more complex initialization with all options set could look like this:
68 | ```javascript
69 | $(document).ready(function() {
70 | $.fn.fullpage({
71 | verticalCentered: true,
72 | resize : true,
73 | slidesColor : ['#ccc', '#fff'],
74 | anchors:['firstSlide', 'secondSlide'],
75 | scrollingSpeed: 700,
76 | easing: 'easeInQuart',
77 | menu: false,
78 | navigation: false,
79 | navigationPosition: 'right',
80 | navigationTooltips: ['firstSlide', 'secondSlide'],
81 | slidesNavigation: true,
82 | slidesNavPosition: 'bottom',
83 | loopBottom: false,
84 | loopTop: false,
85 | loopHorizontal: true,
86 | autoScrolling: true,
87 | scrollOverflow: false,
88 | css3: false,
89 | paddingTop: '3em',
90 | paddingBottom: '10px',
91 | fixedElements: '#element1, .element2',
92 | normalScrollElements: '#element1, .element2',
93 |
94 | //events
95 | onLeave: function(index, direction){},
96 | afterLoad: function(anchorLink, index){},
97 | afterRender: function(){},
98 | afterSlideLoad: function(anchorLink, index, slideAnchor, slideIndex)
99 | });
100 | });
101 | ```
102 |
103 | ### Advance usage
104 | In order to create links to certain slides inside a section, you could do it in two ways:
105 |
106 | #### Using anchor links
107 | If you are using fullPage.js with anchor links for the sections (using the `anchors` option), then you will be able to use anchor links also to navigate directly to a certain slide inside a section.
108 |
109 | You can do it by using the index of the slide (starting by 0), or if you prefer, you can create custom anchor links for them by using the attribute `data-anchor` in each slide. For example:
110 |
111 | ```html
112 |
113 |
Slide 1
114 |
Slide 2
115 |
Slide 3
116 |
Slide 4
117 |
118 | ```
119 |
120 | #### Using events:
121 | - `class="toSlide"`
122 | - `data-index="3"` (or whatever slide number you want to link)
123 |
124 | For example:
125 | ```html
126 | Click here to go to slide 3
127 | ```
128 | [Live example](http://jsfiddle.net/7PwsS/15/)
129 |
130 | To create links between sections, you could use the `menu` option and make use of anchor links (#) as explained below in the options section.
131 |
132 | ## Options
133 |
134 | - `verticalCentered`: (default `true`) Vertically centering of the content within sections.
135 |
136 | - `resize`: (default `true`) Whether you want to resize the text when the window is resized.
137 |
138 | - `scrollingSpeed`: (default `700`) Speed in miliseconds for the scrolling transitions.
139 |
140 | - `slidesColor`:(default `none`) Define the CSS `background-color` property for each section:
141 | Example:
142 | ```javascript
143 | $.fn.fullpage({
144 | slidesColor: ['#f2f2f2', '#4BBFC3', '#7BAABE', 'whitesmoke', '#000'],
145 | });
146 | ```
147 |
148 | - `anchors`: (default `[]`) Defines the anchor links (#example) to be shown on the URL for each section. Using anchors forward and backward navigation will also be possible through the browser. This option also allows users to bookmark a specific section or slide.
149 |
150 | - `easing`: (default `easeInQuart`) Defines the transition effect to use for the vertical scrolling.
151 | It requieres [jQuery UI](http://jqueryui.com/) for using some of its transitions. Other libraries could be used instead.
152 |
153 | - `loopTop`: (default `false`) Defines whether scrolling up in the first section should scroll to the last one or not.
154 |
155 | - `loopBottom`: (default `false`) Defines whether scrolling down in the last section should scroll to the first one or not.
156 |
157 | - `loopHorizontal`: (default `true`) Defines whether horizontal sliders will loop after reaching the last or previous slide or not.
158 |
159 | - `css3`: (default `false`). Defines wheter to use JavaScript or CSS3 transforms to scroll within sections and slides. Useful to speed up the movement in tablet and mobile devices with browsers supporting CSS3. If this option is set to `true` and the browser doesn't support CSS3, a jQuery fallback will be used instead.
160 |
161 | - `autoScrolling`: (default `true`) Defines whether to use the "automatic" scrolling or the "normal" one. It also has affects the way the sections fit in the browser/device window in tablets and mobile phones.
162 |
163 | - `paddingTop`: (default `0`) Defines the top padding for each section with a numerical value and its measure (paddingTop: '10px', paddingTop: '10em'...) Useful in case of using a fixed header.
164 |
165 | - `paddingBottom`: (default `0`) Defines the bottom padding for each section with a numerical value and its measure (paddingBottom: '10px', paddingBottom: '10em'...). Useful in case of using a fixed footer.
166 |
167 | - `fixedElements`: (default `null`) Defines which elements will be taken off the scrolling structure of the plugin which is necesary when using the `css3` otpion to keep them fixed. It requires a string with the jQuery selectors for those elements. (For example: `fixedElements: '#element1, .element2'`)
168 |
169 | - `normalScrollElements`: (default `null`) If you want to avoid the auto scroll when scrolling over some elements, this is the option you need to use. (useful for maps, scrolling divs etc.) It requires a string with the jQuery selectors for those elements. (For example: `normalScrollElements: '#element1, .element2'`)
170 |
171 | - `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`.
172 | This won't generate a menu but will just add the `active` class to the element in the given menu with the corresponding anchor links.
173 | In order to link the elements of the menu with the slides, an HTML 5 data-tag (`data-menuanchor`) will be needed to use with the same anchor links as
174 | used within the sections. Example:
175 | ```html
176 |
182 | ```
183 | ```javascript
184 | $.fn.fullpage({
185 | anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
186 | menu: '#myMenu'
187 | });
188 | ```
189 |
190 | - `navigation`: (default `false`) If set to `true`, it will show a navigation bar made up of small circles.
191 |
192 | - `navigationPosition`: (default `none`) It can be set to `left` or `right` and defines which position the navigation bar will be shown (if using one).
193 |
194 | - `navigationTooltips`: (default []) Defines the tooltips to show for the navigation circles in case they are being used. Example: `navigationTooltips: ['firstSlide', 'secondSlide']`.
195 |
196 | - `slidesNavigation`: (default `false`) If set to `true` it will show a navigation bar made up of small circles for each landscape slider on the site.
197 |
198 | - `slidesNavPosition`: (default `bottom`) Defines the position for the landscape navigation bar for sliders. Admits `top` and `bottom` as values. You may want to modify the CSS styles to determine the distance from the top or bottom as well as any other style such as color.
199 |
200 | - `scrollOverflow`: (default `false`) defines whether or not to create a scroll for the section in case its content is bigger than the height of it.
201 | In case of setting it to `true`, it requieres the vendor plugin [`jquery.slimscroll.min`](https://github.com/rochal/jQuery-slimScroll) and it should be loaded before the fullPaje.js plugin. For example:
202 |
203 | ```html
204 |
205 |
206 | ```
207 |
208 | ## Methods
209 |
210 | ### moveSlideUp
211 | Scrolls one slide up:
212 | ```javascript
213 | $.fn.fullpage.moveSlideUp();
214 | ```
215 |
216 | ### moveSlideDown
217 | Scrolls one slide down:
218 | ```javascript
219 | $.fn.fullpage.moveSlideDown();
220 | ```
221 |
222 | ### moveToSlide
223 | Scrolls the page to the given slide anchor name or to the given index.
224 | ```javascript
225 | /*Scrolling to the section with the anchor link `firstSlide` */
226 | $.fn.fullpage.moveToSlide('firstSlide');
227 |
228 | ```
229 |
230 | ```javascript
231 | /*Scrolling to the 3rd section in the site*/
232 | $.fn.fullpage.moveToSlide(3);
233 | ```
234 |
235 | ### setAutoScrolling
236 | Sets the scrolling configuration in real time.
237 | Defines the way the page scrolling behaves. If it is set to `true`, it will use the "automatic" scrolling, otherwise, it will use the "manual" or "normal" scrolling of the site. Be careful when combining this option with `scrollOverflow` set to true, as it might be difficult to scroll using the mouse wheel or the trackpad when the section is scrollable.
238 |
239 | ```javascript
240 | $.fn.fullpage.setAutoScrolling(false);
241 | ```
242 |
243 | ## Callbacks
244 | ###afterLoad (`anchorLink`, `index`)
245 | Callback fired once the sections have been loaded, after the scrolling has ended.
246 | Parameters:
247 |
248 | - `anchorLink`: anchorLink corresponding to the section.
249 | - `index`: index of the section. Starting from 1.
250 |
251 | In case of not having anchorLinks defined in the plugin the `index` parameter would be the only one to use.
252 |
253 | Example:
254 |
255 | ```javascript
256 | $.fn.fullpage({
257 | anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
258 |
259 | afterLoad: function(anchorLink, index){
260 | //using index
261 | if(index == '3'){
262 | alert("Section 3 ended loading");
263 | }
264 |
265 | //using anchorLink
266 | if(anchorLink == 'secondSlide'){
267 | alert("Section 2 ended loading");
268 | }
269 | }
270 | });
271 | ```
272 |
273 | ###onLeave (`index`, `direction`)
274 | This callback is fired once the user leaves a section, in the transition to the new section.
275 |
276 | Parameters:
277 |
278 | - `index`: index of the leaving section. Starting from 1.
279 | - `direction`: it will take the values `up` or `down` depending on the scrolling direction.
280 |
281 | Example:
282 |
283 | ```javascript
284 | $.fn.fullpage({
285 | onLeave: function(index, direction){
286 | //after leaving section 2
287 | if(index == '2' && direction =='down'){
288 | alert("Going to section 3!");
289 | }
290 |
291 | else if(index == '2' && direction == 'up'){
292 | alert("Going to section 1!");
293 | }
294 | }
295 | });
296 | ```
297 |
298 |
299 | ###afterRender()
300 | This callback is fired just after the structure of the page is generated. This is the callback you want to use to initialize other plugins or fire any code which requires the document to be ready (as this plugin modifies the DOM to create the resulting structure).
301 |
302 | Example:
303 |
304 | ```javascript
305 | $.fn.fullpage({
306 | afterRender: function(){
307 | alert("The resulting DOM stucture is ready");
308 | }
309 | });
310 | ```
311 |
312 |
313 | ###afterSlideLoad (`anchorLink`, `index`, `slideAnchor`, `slideIndex`)
314 | Callback fired once the slide of a section have been loaded, after the scrolling has ended.
315 | Parameters:
316 |
317 | - `anchorLink`: anchorLink corresponding to the section.
318 | - `index`: index of the section. Starting from 1.
319 | - `slideAnchor`: anchor corresponding to the slide (in case there is)
320 | - `slideIndex`: index of the slide. Starting from 1. (the default slide doesn't count as slide, but as a section)
321 |
322 |
323 | In case of not having anchorLinks defined for the slide or slides the `slideIndex` parameter would be the only one to use.
324 | Example:
325 |
326 | ```javascript
327 | $.fn.fullpage({
328 | anchors: ['firstPage', 'secondPage', 'thirdPage', 'fourthPage', 'lastPage'],
329 |
330 | afterSlideLoad: function( anchorLink, index, slideAnchor, slideIndex){
331 |
332 | //first slide of the second section
333 | if(anchorLink == 'secondPage' && slideIndex == 1){
334 | alert("First slide loaded");
335 | }
336 |
337 | //second slide of the second section (supposing #secondSlide is the
338 | //anchor for the second slide
339 | if(index == 2 && slideIndex == 'secondSlide'){
340 | alert("Second slide loaded");
341 | }
342 | }
343 | });
344 | ```
345 |
346 | ## Who is using fullPage.js
347 | If you want your page to be listed here. Please contact me with the URL
348 |
349 | - http://rockercreative.com/
350 | - http://www.jennbeaupre.com/grime/
351 | - http://www.ondamujer.com
352 | - http://www.omqcomics.com/
353 | - http://www.carlphot.com/
354 | - http://www.villareginateodolinda.it
355 | - http://rodrigo.maroto.me
356 | - http://azul257.com.mx
357 |
358 | ## Donations
359 | Donations would be more than welcome :)
360 |
361 | [](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=BEK5JQCQMED4J&lc=GB&item_name=fullPage%2ejs¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted)
362 |
363 |
364 | ## License
365 |
366 | (The MIT License)
367 |
368 | Copyright (c) 2013 Alvaro Trigo <alvaro@alvarotrigo.com>
369 |
370 | Permission is hereby granted, free of charge, to any person obtaining
371 | a copy of this software and associated documentation files (the
372 | 'Software'), to deal in the Software without restriction, including
373 | without limitation the rights to use, copy, modify, merge, publish,
374 | distribute, sublicense, and/or sell copies of the Software, and to
375 | permit persons to whom the Software is furnished to do so, subject to
376 | the following conditions:
377 |
378 | The above copyright notice and this permission notice shall be
379 | included in all copies or substantial portions of the Software.
380 |
381 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
382 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
383 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
384 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
385 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
386 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
387 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
388 |
--------------------------------------------------------------------------------
/jquery.fullPage.js:
--------------------------------------------------------------------------------
1 | /**
2 | * fullPage 1.4.6
3 | * https://github.com/alvarotrigo/fullPage.js
4 | * MIT licensed
5 | *
6 | * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo
7 | */
8 |
9 | (function($) {
10 | $.fn.fullpage = function(options) {
11 | // Create some defaults, extending them with any options that were provided
12 | options = $.extend({
13 | "verticalCentered" : true,
14 | 'resize' : true,
15 | 'slidesColor' : [],
16 | 'anchors':[],
17 | 'scrollingSpeed': 700,
18 | 'easing': 'easeInQuart',
19 | 'menu': false,
20 | 'navigation': false,
21 | 'navigationPosition': 'right',
22 | 'navigationColor': '#000',
23 | 'navigationTooltips': [],
24 | 'slidesNavigation': false,
25 | 'slidesNavPosition': 'bottom',
26 | 'controlArrowColor': '#fff',
27 | 'loopBottom': false,
28 | 'loopTop': false,
29 | 'loopHorizontal': true,
30 | 'autoScrolling': true,
31 | 'scrollOverflow': false,
32 | 'css3': false,
33 | 'paddingTop': 0,
34 | 'paddingBottom': 0,
35 | 'fixedElements': null,
36 | 'normalScrollElements': null,
37 |
38 | //events
39 | 'afterLoad': null,
40 | 'onLeave': null,
41 | 'afterRender': null,
42 | 'afterSlideLoad': null
43 | }, options);
44 |
45 |
46 |
47 | //Defines the delay to take place before being able to scroll to the next section
48 | //BE CAREFUL! Not recommened to change it under 400 for a good behavior in laptops and
49 | //Apple devices (laptops, mouses...)
50 | var scrollDelay = 700;
51 |
52 | $.fn.fullpage.setAutoScrolling = function(value){
53 | options.autoScrolling = value;
54 |
55 | var element = $('.section.active');
56 |
57 | if(options.autoScrolling){
58 | $('html, body').css({
59 | 'overflow' : 'hidden',
60 | 'height' : '100%'
61 | });
62 |
63 | if(element.length){
64 | //moving the container up
65 | if(options.css3){
66 | var translate3d = 'translate3d(0px, -' + element.position().top + 'px, 0px)';
67 | transformContainer(translate3d, false)
68 | }else{
69 | //deleting the possible negative top
70 | $('#superContainer').css('top', '-' + element.position().top + 'px');
71 | }
72 | }
73 |
74 | }else{
75 | $('html, body').css({
76 | 'overflow' : 'auto',
77 | 'height' : 'auto'
78 | });
79 |
80 | if(options.css3){
81 | //moving the container up
82 | var translate3d = 'translate3d(0px, 0px, 0px)';
83 | transformContainer(translate3d, false)
84 | }else{
85 | //deleting the possible negative top
86 | $('#superContainer').css('top', '0px');
87 | }
88 |
89 | //scrolling the page to the section with no animation
90 | $('html, body').scrollTop(element.position().top);
91 | }
92 |
93 | };
94 |
95 |
96 | //flag to avoid very fast sliding for landscape sliders
97 | var slideMoving = false;
98 |
99 | var isTablet = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|BlackBerry|Windows Phone)/);
100 |
101 | var windowsHeight = $(window).height();
102 | var isMoving = false;
103 | var lastScrolledDestiny;
104 |
105 | addScrollEvent();
106 |
107 | //if css3 is not supported, it will use jQuery animations
108 | if(options.css3){
109 | options.css3 = support3d();
110 | }
111 |
112 | $('body').wrapInner('
');
113 |
114 | //creating the navigation dots
115 | if (options.navigation) {
116 | $('body').append('');
117 | var nav = $('#fullPage-nav');
118 |
119 | nav.css('color', options.navigationColor);
120 | nav.addClass(options.navigationPosition);
121 | }
122 |
123 |
124 | $('.section').each(function(index){
125 | var slides = $(this).find('.slide');
126 | var numSlides = slides.length;
127 |
128 | if(!index){
129 | $(this).addClass('active');
130 | }
131 |
132 | $(this).css('height', windowsHeight + 'px');
133 |
134 | if(options.paddingTop || options.paddingBottom){
135 | $(this).css('padding', options.paddingTop + ' 0 ' + options.paddingBottom + ' 0');
136 | }
137 |
138 | if (typeof options.slidesColor[index] !== 'undefined') {
139 | $(this).css('background-color', options.slidesColor[index]);
140 | }
141 |
142 | if (typeof options.anchors[index] !== 'undefined') {
143 | $(this).attr('data-anchor', options.anchors[index]);
144 | }
145 |
146 |
147 | if (options.navigation) {
148 | var link = '';
149 | if(options.anchors.length){
150 | link = options.anchors[index];
151 | }
152 | var tooltip = options.navigationTooltips[index];
153 | if(typeof tooltip === 'undefined'){
154 | tooltip = '';
155 | }
156 |
157 | nav.find('ul').append(' ');
158 | }
159 |
160 | // if there's any slide
161 | if (numSlides > 0) {
162 | var sliderWidth = numSlides * 100;
163 | var slideWidth = 100 / numSlides;
164 |
165 | slides.wrapAll('
');
166 | slides.parent().wrap('
');
167 |
168 | $(this).find('.slidesContainer').css('width', sliderWidth + '%');
169 | $(this).find('.slides').after('
');
170 | $(this).find('.controlArrow.next').css('border-color', 'transparent transparent transparent '+options.controlArrowColor);
171 | $(this).find('.controlArrow.prev').css('border-color', 'transparent '+ options.controlArrowColor + ' transparent transparent');
172 |
173 | if(!options.loopHorizontal){
174 | $(this).find('.controlArrow.prev').hide();
175 | }
176 |
177 |
178 | if(options.slidesNavigation){
179 | addSlidesNavigation($(this), numSlides);
180 | }
181 |
182 | slides.each(function(index) {
183 | if(!index){
184 | $(this).addClass('active');
185 | }
186 |
187 | $(this).css('width', slideWidth + '%');
188 |
189 | if(options.verticalCentered){
190 | addTableClass($(this));
191 | }
192 | });
193 | }else{
194 | if(options.verticalCentered){
195 | addTableClass($(this));
196 | }
197 | }
198 |
199 |
200 |
201 |
202 | }).promise().done(function(){
203 | $.fn.fullpage.setAutoScrolling(options.autoScrolling);
204 |
205 | $.isFunction( options.afterRender ) && options.afterRender.call( this);
206 |
207 | //fixed elements need to be moved out of the plugin container due to problems with CSS3.
208 | if(options.fixedElements && options.css3){
209 | $(options.fixedElements).appendTo('body');
210 | }
211 |
212 | //vertical centered of the navigation + first bullet active
213 | if(options.navigation){
214 | nav.css('margin-top', '-' + (nav.height()/2) + 'px');
215 | nav.find('li').first().find('a').addClass('active');
216 | }
217 |
218 | //moving the menu outside the main container (avoid problems with fixed positions when using CSS3 tranforms)
219 | if(options.menu && options.css3){
220 | $(options.menu).appendTo('body');
221 | }
222 |
223 | if(options.scrollOverflow){
224 | //after DOM and images are loaded
225 | $(window).on('load', function() {
226 |
227 | $('.section').each(function(){
228 | var slides = $(this).find('.slide');
229 |
230 | if(slides.length){
231 | slides.each(function(){
232 | createSlimScrolling($(this));
233 | });
234 | }else{
235 | createSlimScrolling($(this));
236 | }
237 |
238 | });
239 | });
240 | }
241 |
242 | $(window).on('load', function() {
243 | scrollToAnchor();
244 | });
245 |
246 | });
247 |
248 | var scrollId;
249 | var isScrolling = false;
250 |
251 | //when scrolling...
252 | $(window).scroll(function(e){
253 |
254 | if(!options.autoScrolling){
255 | var currentScroll = $(window).scrollTop();
256 |
257 | var scrolledSections = $('.section').map(function(){
258 | if ($(this).offset().top < (currentScroll + 100)){
259 | return $(this);
260 | }
261 | });
262 |
263 | //geting the last one, the current one on the screen
264 | var currentSection = scrolledSections[scrolledSections.length-1];
265 |
266 | //executing only once the first time we reach the section
267 | if(!currentSection.hasClass('active')){
268 | isScrolling = true;
269 |
270 | var yMovement = getYmovement(currentSection);
271 |
272 | $('.section.active').removeClass('active');
273 | currentSection.addClass('active');
274 |
275 | var anchorLink = currentSection.data('anchor');
276 | $.isFunction( options.onLeave ) && options.onLeave.call( this, currentSection.index('.section'), yMovement);
277 |
278 | $.isFunction( options.afterLoad ) && options.afterLoad.call( this, anchorLink, (currentSection.index('.section') + 1));
279 |
280 | activateMenuElement(anchorLink);
281 | activateNavDots(anchorLink, 0);
282 |
283 |
284 | if(options.anchors.length && !isMoving){
285 | //needed to enter in hashChange event when using the menu with anchor links
286 | lastScrolledDestiny = anchorLink;
287 |
288 | location.hash = anchorLink;
289 | }
290 |
291 | //small timeout in order to avoid entering in hashChange event when scrolling is not finished yet
292 | clearTimeout(scrollId);
293 | scrollId = setTimeout(function(){
294 | isScrolling = false;
295 | }, 100);
296 | }
297 |
298 | }
299 | });
300 |
301 |
302 |
303 |
304 | var touchStartY = 0;
305 | var touchStartX = 0;
306 | var touchEndY = 0;
307 | var touchEndX = 0;
308 |
309 | /* Detecting touch events
310 |
311 | * As we are changing the top property of the page on scrolling, we can not use the traditional way to detect it.
312 | * This way, the touchstart and the touch moves shows an small difference between them which is the
313 | * used one to determine the direction.
314 | */
315 | $(document).on('touchmove', function(event){
316 | if(options.autoScrolling && isTablet){
317 | //preventing the easing on iOS devices
318 | event.preventDefault();
319 | var e = event.originalEvent;
320 | var touchMoved = false;
321 |
322 | if (!isMoving) { //if theres any #
323 |
324 | touchEndY = e.touches[0].pageY;
325 | touchEndX = e.touches[0].pageX;
326 |
327 |
328 | //if movement in the X axys is bigger than in the Y and the currect section has slides...
329 | if($('.section.active').find('.slides').length && Math.abs(touchStartX - touchEndX) > Math.abs(touchStartY - touchEndY) ){
330 | if(touchStartX > touchEndX){
331 | $('.section.active').find('.controlArrow.next').trigger('click');
332 | }
333 | else if(touchStartX < touchEndX){
334 | $('.section.active').find('.controlArrow.prev').trigger('click');
335 | }
336 | }
337 | //vertical scrolling
338 | else{
339 | var scrollable = $('.section.active').find('.scrollable');
340 | if(touchStartY > touchEndY){
341 | if(scrollable.length > 0 ){
342 | //is the scrollbar at the end of the scroll?
343 | if(isScrolled('bottom', scrollable)){
344 | $.fn.fullpage.moveSlideDown();
345 | }else{
346 | return true;
347 | }
348 | }else{
349 | // moved down
350 | $.fn.fullpage.moveSlideDown();
351 | }
352 | } else {
353 |
354 | if(scrollable.length > 0){
355 | //is the scrollbar at the start of the scroll?
356 | if(isScrolled('top', scrollable)){
357 | $.fn.fullpage.moveSlideUp();
358 | }
359 | else{
360 | return true;
361 | }
362 | }else{
363 | // moved up
364 | $.fn.fullpage.moveSlideUp();
365 | }
366 | }
367 | }
368 | }
369 | }
370 | });
371 |
372 | $(document).on('touchstart', function(event){
373 | if(options.autoScrolling && isTablet){
374 | var e = event.originalEvent;
375 | touchStartY = e.touches[0].pageY;
376 | touchStartX = e.touches[0].pageX;
377 | }
378 | });
379 |
380 |
381 |
382 | /**
383 | * Detecting mousewheel scrolling
384 | *
385 | * http://blogs.sitepointstatic.com/examples/tech/mouse-wheel/index.html
386 | * http://www.sitepoint.com/html5-javascript-mouse-wheel/
387 | */
388 | function MouseWheelHandler(e) {
389 | if(options.autoScrolling){
390 | // cross-browser wheel delta
391 | e = window.event || e;
392 | var delta = Math.max(-1, Math.min(1,
393 | (e.wheelDelta || -e.detail)));
394 | var scrollable;
395 | var activeSection = $('.section.active');
396 |
397 | if (!isMoving) { //if theres any #
398 |
399 | //if there are landscape slides, we check if the scrolling bar is in the current one or not
400 | if(activeSection.find('.slides').length){
401 | scrollable= activeSection.find('.slide.active').find('.scrollable');
402 | }else{
403 | scrollable = activeSection.find('.scrollable');
404 | }
405 |
406 | //scrolling down?
407 | if (delta < 0) {
408 | if(scrollable.length > 0 ){
409 | //is the scrollbar at the end of the scroll?
410 | if(isScrolled('bottom', scrollable)){
411 | $.fn.fullpage.moveSlideDown();
412 | }else{
413 | return true; //normal scroll
414 | }
415 | }else{
416 | $.fn.fullpage.moveSlideDown();
417 | }
418 | }
419 |
420 | //scrolling up?
421 | else {
422 | if(scrollable.length > 0){
423 | //is the scrollbar at the start of the scroll?
424 | if(isScrolled('top', scrollable)){
425 | $.fn.fullpage.moveSlideUp();
426 | }else{
427 | return true; //normal scroll
428 | }
429 | }else{
430 | $.fn.fullpage.moveSlideUp();
431 | }
432 | }
433 | }
434 |
435 | return false;
436 | }
437 | }
438 |
439 |
440 | function addScrollEvent(){
441 | if (document.addEventListener) {
442 | document.addEventListener("mousewheel", MouseWheelHandler, false); //IE9, Chrome, Safari, Oper
443 | document.addEventListener("DOMMouseScroll", MouseWheelHandler, false); //Firefox
444 | } else {
445 | document.attachEvent("onmousewheel", MouseWheelHandler); //IE 6/7/8
446 | }
447 | }
448 |
449 | $.fn.fullpage.moveSlideUp = function(){
450 | var prev = $('.section.active').prev('.section');
451 |
452 | //looping to the bottom if there's no more sections above
453 | if(options.loopTop && !prev.length){
454 | prev = $('.section').last();
455 | }
456 |
457 | if (prev.length > 0 || (!prev.length && options.loopTop)){
458 | scrollPage(prev);
459 | }
460 | };
461 |
462 | $.fn.fullpage.moveSlideDown = function (){
463 | var next = $('.section.active').next('.section');
464 |
465 | //looping to the top if there's no more sections below
466 | if(options.loopBottom && !next.length){
467 | next = $('.section').first();
468 | }
469 |
470 | if (next.length > 0 || (!next.length && options.loopBottom)){
471 | scrollPage(next);
472 | }
473 | };
474 |
475 | $.fn.fullpage.moveToSlide = function (index){
476 | var destiny = '';
477 |
478 | if(isNaN(index)){
479 | destiny = $('[data-anchor="'+index+'"]');
480 | }else{
481 | destiny = $('.section').eq( (index -1) );
482 | }
483 |
484 | if (destiny.length > 0) {
485 | scrollPage(destiny);
486 | }
487 | };
488 |
489 | function scrollPage(element, callback) {
490 | var scrollOptions = {}, scrolledElement;
491 | var dest = element.position();
492 | var dtop = dest !== null ? dest.top : null;
493 | var yMovement = getYmovement(element);
494 | var anchorLink = element.data('anchor');
495 | var sectionIndex = element.index('.section');
496 | var leavingSection = $('.section.active').index('.section') + 1;
497 |
498 | element.addClass('active').siblings().removeClass('active');
499 |
500 | //preventing from activating the MouseWheelHandler event
501 | //more than once if the page is scrolling
502 | isMoving = true;
503 |
504 | if(!$.isFunction( callback )){
505 | if(typeof anchorLink !== 'undefined'){
506 | location.hash = anchorLink;
507 | }else{
508 | location.hash = '';
509 | }
510 | }
511 |
512 | if(options.autoScrolling){
513 | scrollOptions['top'] = -dtop;
514 | scrolledElement = '#superContainer';
515 | }else{
516 | scrollOptions['scrollTop'] = dtop;
517 | scrolledElement = 'html, body';
518 | }
519 |
520 | if(options.css3 && options.autoScrolling){
521 |
522 |
523 | $.isFunction( options.onLeave ) && options.onLeave.call( this, leavingSection, yMovement);
524 |
525 | var translate3d = 'translate3d(0px, -' + dtop + 'px, 0px)';
526 | transformContainer(translate3d, true);
527 |
528 | setTimeout(function(){
529 | $.isFunction( options.afterLoad ) && options.afterLoad.call( this, anchorLink, (sectionIndex + 1));
530 |
531 | setTimeout(function(){
532 | isMoving = false;
533 | $.isFunction( callback ) && callback.call( this);
534 | }, scrollDelay);
535 | }, options.scrollingSpeed);
536 | }else{
537 | $.isFunction( options.onLeave ) && options.onLeave.call( this, leavingSection, yMovement);
538 |
539 | $(scrolledElement).animate(
540 | scrollOptions
541 | , options.scrollingSpeed, options.easing, function() {
542 | //callback
543 | $.isFunction( options.afterLoad ) && options.afterLoad.call( this, anchorLink, (sectionIndex + 1));
544 |
545 | setTimeout(function(){
546 | isMoving = false;
547 | $.isFunction( callback ) && callback.call( this);
548 | }, scrollDelay);
549 | });
550 | }
551 |
552 | //flag to avoid callingn `scrollPage()` twice in case of using anchor links
553 | lastScrolledDestiny = anchorLink;
554 |
555 | //avoid firing it twice (as it does also on scroll)
556 | if(options.autoScrolling){
557 | activateMenuElement(anchorLink);
558 | activateNavDots(anchorLink, sectionIndex);
559 | }
560 | }
561 |
562 | function scrollToAnchor(){
563 | //getting the anchor link in the URL and deleting the `#`
564 | var value = window.location.hash.replace('#', '').split('/');
565 | var section = value[0];
566 | var slide = value[1];
567 |
568 | if(section){ //if theres any #
569 | scrollPageAndSlide(section, slide);
570 | }
571 | }
572 |
573 | //detecting any change on the URL to scroll to the given anchor link
574 | //(a way to detect back history button as we play with the hashes on the URL)
575 | $(window).on('hashchange',function(){
576 | if(!isScrolling){
577 | var value = window.location.hash.replace('#', '').split('/');
578 | var section = value[0];
579 | var slide = value[1];
580 |
581 |
582 | /*in order to call scrollpage() only once for each destination at a time
583 | It is called twice for each scroll otherwise, as in case of using anchorlinks `hashChange`
584 | event is fired on every scroll too.*/
585 | if (section && section !== lastScrolledDestiny || (typeof slide != 'undefined' && !slideMoving)) {
586 | scrollPageAndSlide(section, slide);
587 | }
588 | }
589 | });
590 |
591 |
592 | /**
593 | * Sliding with arrow keys, both, vertical and horizontal
594 | */
595 | $(document).keydown(function(e) {
596 | //Moving the mian page with the keyboard arrows
597 | if (!isMoving) {
598 | switch (e.which) {
599 | //up
600 | case 38:
601 | case 33:
602 | $.fn.fullpage.moveSlideUp();
603 | break;
604 |
605 | //down
606 | case 40:
607 | case 34:
608 | $.fn.fullpage.moveSlideDown();
609 | break;
610 |
611 | //left
612 | case 37:
613 | $('.section.active').find('.controlArrow.prev').trigger('click');
614 | break;
615 |
616 | //right
617 | case 39:
618 | $('.section.active').find('.controlArrow.next').trigger('click');
619 | break;
620 |
621 | default:
622 | return; // exit this handler for other keys
623 | }
624 | }
625 | });
626 |
627 | //navigation action
628 | $(document).on('click', '#fullPage-nav a', function(e){
629 | e.preventDefault();
630 | var index = $(this).parent().index();
631 | scrollPage($('.section').eq(index));
632 | });
633 |
634 | //navigation tooltips
635 | $(document).on({
636 | mouseenter: function(){
637 | var tooltip = $(this).data('tooltip');
638 | $('' + tooltip + '
').hide().appendTo($(this)).fadeIn(200);
639 | },
640 | mouseleave: function(){
641 | $(this).find('.fullPage-tooltip').fadeOut().remove();
642 | }
643 | }, '#fullPage-nav li');
644 |
645 |
646 | if(options.normalScrollElements){
647 | $(document).on('mouseover', options.normalScrollElements, function () {
648 | if (document.addEventListener) {
649 | document.removeEventListener('mousewheel', MouseWheelHandler, false); //IE9, Chrome, Safari, Oper
650 | document.removeEventListener('DOMMouseScroll', MouseWheelHandler, false); //Firefox
651 | } else {
652 | document.detachEvent("onmousewheel", MouseWheelHandler); //IE 6/7/8
653 | }
654 | });
655 |
656 | $(document).on('mouseout', options.normalScrollElements, function(){
657 | addScrollEvent();
658 | });
659 | }
660 |
661 | /**
662 | * Scrolling horizontally when clicking on the slider controls.
663 | */
664 | $('.section').on('click', '.controlArrow', function() {
665 | //not that fast my friend! :)
666 | if (slideMoving) {
667 | return;
668 | }
669 | slideMoving = true;
670 |
671 | var slides = $(this).closest('.section').find('.slides');
672 | var currentSlide = slides.find('.slide.active');
673 | var destiny = null;
674 |
675 | if ($(this).hasClass('prev')) {
676 | destiny = currentSlide.prev('.slide');
677 | } else {
678 | destiny = currentSlide.next('.slide');
679 | }
680 |
681 | //is there isn't a next slide in the secuence?
682 | if(!destiny.length) {
683 | //to the last
684 | if ($(this).hasClass('prev')) {
685 | destiny = currentSlide.siblings(':last');
686 | } else {
687 | destiny = currentSlide.siblings(':first');
688 | }
689 | }
690 |
691 | landscapeScroll(slides, destiny);
692 | });
693 |
694 |
695 | /**
696 | * Scrolling horizontally when clicking on the slider controls.
697 | */
698 | $('.section').on('click', '.toSlide', function(e) {
699 | e.preventDefault();
700 |
701 | var slides = $(this).closest('.section').find('.slides');
702 | var currentSlide = slides.find('.slide.active');
703 | var destiny = null;
704 |
705 | destiny = slides.find('.slide').eq( ($(this).data('index') -1) );
706 |
707 | if(destiny.length > 0){
708 | landscapeScroll(slides, destiny);
709 | }
710 | });
711 |
712 | /**
713 | * Scrolls horizontal sliders.
714 | */
715 | function landscapeScroll(slides, destiny){
716 | var destinyPos = destiny.position();
717 | var slidesContainer = slides.find('.slidesContainer').parent();
718 | var slideIndex = destiny.index();
719 | var section = slides.closest('.section');
720 | var sectionIndex = section.index();
721 | var anchorLink = section.data('anchor');
722 | var slidesNav = section.find('.fullPage-slidesNav');
723 | var slideAnchor = destiny.data('anchor');
724 |
725 | destiny.addClass('active').siblings().removeClass('active');
726 |
727 |
728 | if(typeof slideAnchor === 'undefined'){
729 | slideAnchor = slideIndex;
730 | }
731 |
732 | //only changing the URL if the slides are in the current section (not for resize re-adjusting)
733 | if(section.hasClass('active')){
734 |
735 | if(!options.loopHorizontal){
736 | //hidding it for the fist slide, showing for the rest
737 | section.find('.controlArrow.prev').toggle(slideIndex!=0);
738 |
739 | //hidding it for the last slide, showing for the rest
740 | section.find('.controlArrow.next').toggle(!destiny.is(':last-child'));
741 | }
742 | //isn't it the first slide?
743 | if(slideIndex){
744 | if(typeof anchorLink !== 'undefined'){
745 | var sectionHash = anchorLink;
746 | }else{
747 | var sectionHash = '';
748 | }
749 |
750 | location.hash = sectionHash + '/' + slideAnchor;
751 | //first slide
752 | }else{
753 | location.hash = location.hash.split('/')[0];
754 | }
755 | }
756 |
757 | if(options.css3){
758 | var translate3d = 'translate3d(-' + destinyPos.left + 'px, 0px, 0px)';
759 |
760 | slides.find('.slidesContainer').addClass('easing').css({
761 | '-webkit-transform': translate3d,
762 | '-moz-transform': translate3d,
763 | '-ms-transform':translate3d,
764 | 'transform': translate3d
765 | });
766 | setTimeout(function(){
767 | $.isFunction( options.afterSlideLoad ) && options.afterSlideLoad.call( this, anchorLink, (sectionIndex + 1), slideAnchor, slideIndex );
768 |
769 | slideMoving = false;
770 | }, options.scrollingSpeed);
771 | }else{
772 | slidesContainer.animate({
773 | scrollLeft : destinyPos.left
774 | }, options.scrollingSpeed, function() {
775 |
776 | $.isFunction( options.afterSlideLoad ) && options.afterSlideLoad.call( this, anchorLink, (sectionIndex + 1), slideAnchor, slideIndex);
777 |
778 | //letting them slide again
779 | slideMoving = false;
780 | });
781 | }
782 |
783 | slidesNav.find('.active').removeClass('active');
784 | slidesNav.find('li').eq(slideIndex).find('a').addClass('active');
785 | }
786 |
787 |
788 | if (!isTablet) {
789 | var resizeId;
790 |
791 | //when resizing the site, we adjust the heights of the sections
792 | $(window).resize(function() {
793 | //in order to call the functions only when the resize is finished
794 | //http://stackoverflow.com/questions/4298612/jquery-how-to-call-resize-event-only-once-its-finished-resizing
795 | clearTimeout(resizeId);
796 | resizeId = setTimeout(doneResizing, 500);
797 | });
798 |
799 | }
800 | $(window).bind('orientationchange', function() {
801 | doneResizing();
802 | });
803 |
804 | /**
805 | * When resizing is finished, we adjust the slides sizes and positions
806 | */
807 | function doneResizing() {
808 | var windowsWidth = $(window).width();
809 | windowsHeight = $(window).height();
810 |
811 | //text and images resizing
812 | if (options.resize) {
813 | resizeMe(windowsHeight, windowsWidth);
814 | }
815 |
816 | $('.section').each(function(){
817 | var scrollHeight = windowsHeight - parseInt($(this).css('padding-bottom')) - parseInt($(this).css('padding-top'));
818 |
819 | //resizing the scrolling divs
820 | if(options.scrollOverflow){
821 | var slides = $(this).find('.slide');
822 |
823 | if(slides.length){
824 | slides.each(function(){
825 | createSlimScrolling($(this));
826 | });
827 | }else{
828 | createSlimScrolling($(this));
829 | }
830 |
831 | }
832 |
833 | //adjusting the height of the table-cell for IE and Firefox
834 | if(options.verticalCentered){
835 | $(this).find('.tableCell').css('height', windowsHeight + 'px');
836 | }
837 |
838 | $(this).css('height', windowsHeight + 'px');
839 |
840 | //adjusting the position fo the FULL WIDTH slides...
841 | var slides = $(this).find('.slides');
842 | if (slides.length) {
843 | landscapeScroll(slides, slides.find('.slide.active'));
844 | }
845 | });
846 |
847 | //adjusting the position for the current section
848 | var destinyPos = $('.section.active').position();
849 |
850 | var activeSection = $('.section.active');
851 |
852 | //isn't it the first section?
853 | if(activeSection.index('.section')){
854 | scrollPage(activeSection);
855 | }
856 | }
857 |
858 | /**
859 | * Resizing of the font size depending on the window size as well as some of the images on the site.
860 | */
861 | function resizeMe(displayHeight, displayWidth) {
862 | //Standard height, for which the body font size is correct
863 | var preferredHeight = 825;
864 | var windowSize = displayHeight;
865 |
866 | /* Problem to be solved
867 |
868 | if (displayHeight < 825) {
869 | var percentage = (windowSize * 100) / preferredHeight;
870 | var newFontSize = percentage.toFixed(2);
871 |
872 | $("img").each(function() {
873 | var newWidth = ((80 * percentage) / 100).toFixed(2);
874 | $(this).css("width", newWidth + '%');
875 | });
876 | } else {
877 | $("img").each(function() {
878 | $(this).css("width", '');
879 | });
880 | }*/
881 |
882 | if (displayHeight < 825 || displayWidth < 900) {
883 | if (displayWidth < 900) {
884 | windowSize = displayWidth;
885 | preferredHeight = 900;
886 | }
887 | var percentage = (windowSize * 100) / preferredHeight;
888 | var newFontSize = percentage.toFixed(2);
889 |
890 | $("body").css("font-size", newFontSize + '%');
891 | } else {
892 | $("body").css("font-size", '100%');
893 | }
894 | }
895 |
896 | /**
897 | * Activating the website navigation dots according to the given slide name.
898 | */
899 | function activateNavDots(name, sectionIndex){
900 | if(options.navigation){
901 | $('#fullPage-nav').find('.active').removeClass('active');
902 | if(name){
903 | $('#fullPage-nav').find('a[href="#' + name + '"]').addClass('active');
904 | }else{
905 | $('#fullPage-nav').find('li').eq(sectionIndex).find('a').addClass('active');
906 | }
907 | }
908 | }
909 |
910 | /**
911 | * Activating the website main menu elements according to the given slide name.
912 | */
913 | function activateMenuElement(name){
914 | if(options.menu){
915 | $(options.menu).find('.active').removeClass('active');
916 | $(options.menu).find('[data-menuanchor="'+name+'"]').addClass('active');
917 | }
918 | }
919 |
920 | /**
921 | * Return a boolean depending on whether the scrollable element is at the end or at the start of the scrolling
922 | * depending on the given type.
923 | */
924 | function isScrolled(type, scrollable){
925 | if(type === 'top'){
926 | return !scrollable.scrollTop();
927 | }else if(type === 'bottom'){
928 | return scrollable.scrollTop() + scrollable.innerHeight() >= scrollable[0].scrollHeight;
929 | }
930 | }
931 |
932 | /**
933 | * Retuns `up` or `down` depending on the scrolling movement to reach its destination
934 | * from the current section.
935 | */
936 | function getYmovement(destiny){
937 | var fromIndex = $('.section.active').index('.section');
938 | var toIndex = destiny.index('.section');
939 |
940 | if(fromIndex > toIndex){
941 | return 'up';
942 | }
943 | return 'down';
944 | }
945 |
946 |
947 | function createSlimScrolling(element){
948 | //needed to make `scrollHeight` work under Opera 12
949 | element.css('overflow', 'hidden');
950 |
951 | //in case element is a slide
952 | var section = element.closest('.section');
953 | var scrollable = element.find('.scrollable');
954 |
955 | //if there was scroll, the contentHeight will be the one in the scrollable section
956 | if(scrollable.length){
957 | var contentHeight = element.find('.scrollable').get(0).scrollHeight - parseInt(section.css('padding-bottom')) - parseInt(section.css('padding-top'));
958 | }else{
959 | var contentHeight = element.get(0).scrollHeight - parseInt(section.css('padding-bottom')) - parseInt(section.css('padding-top'));
960 | }
961 |
962 | //needs scroll?
963 | if ( contentHeight > windowsHeight) {
964 | var scrollHeight = windowsHeight - parseInt(section.css('padding-bottom')) - parseInt(section.css('padding-top'));
965 |
966 | //was there already an scroll ? Updating it
967 | if(scrollable.length){
968 | scrollable.css('height', scrollHeight + 'px').parent().css('height', scrollHeight + 'px');
969 | }
970 | //creating the scrolling
971 | else{
972 | if(options.verticalCentered){
973 | element.find('.tableCell').wrapInner('
');
974 | }else{
975 | element.wrapInner('
');
976 | }
977 |
978 |
979 | element.find('.scrollable').slimScroll({
980 | height: scrollHeight + 'px',
981 | size: '10px',
982 | alwaysVisible: true
983 | });
984 | }
985 | }
986 |
987 | //removing the scrolling when it is not necessary anymore
988 | else{
989 | element.find('.scrollable').children().first().unwrap().unwrap();
990 | element.find('.slimScrollBar').remove();
991 | element.find('.slimScrollRail').remove();
992 | }
993 |
994 | //undo
995 | element.css('overflow', '');
996 | }
997 |
998 | function addTableClass(element){
999 | element.addClass('table').wrapInner('
');
1000 | }
1001 |
1002 |
1003 | /**
1004 | * Adds a css3 transform property to the container class with or without animation depending on the animated param.
1005 | */
1006 | function transformContainer(translate3d, animated){
1007 | $('#superContainer').toggleClass('easing', animated);
1008 |
1009 | $('#superContainer').css({
1010 | '-webkit-transform': translate3d,
1011 | '-moz-transform': translate3d,
1012 | '-ms-transform':translate3d,
1013 | 'transform': translate3d
1014 | });
1015 | }
1016 |
1017 |
1018 | /**
1019 | * Scrolls to the given section and slide
1020 | */
1021 | function scrollPageAndSlide(destiny, slide){
1022 | var section = $('[data-anchor="'+destiny+'"]');
1023 |
1024 | //we need to scroll to the section and then to the slide
1025 | if (destiny !== lastScrolledDestiny){
1026 | scrollPage(section, function(){
1027 | scrollSlider(section, slide)
1028 | });
1029 | }
1030 | //if we were already in the section
1031 | else{
1032 | scrollSlider(section, slide);
1033 | }
1034 |
1035 | }
1036 |
1037 | /**
1038 | * Scrolls the slider to the given slide destination for the given section
1039 | */
1040 | function scrollSlider(section, slide){
1041 | if(typeof slide != 'undefined'){
1042 | var slides = section.find('.slides');
1043 | var destiny = slides.find('[data-anchor="'+slide+'"]');
1044 | if(!destiny.length){
1045 | destiny = slides.find('.slide').eq(slide);
1046 | }
1047 |
1048 | landscapeScroll(slides, destiny);
1049 | }
1050 | }
1051 |
1052 | /**
1053 | * Creates a landscape navigation bar with dots for horizontal sliders.
1054 | */
1055 | function addSlidesNavigation(section, numSlides){
1056 | section.append('');
1057 | var nav = section.find('.fullPage-slidesNav');
1058 |
1059 | //top or bottom
1060 | nav.addClass(options.slidesNavPosition);
1061 |
1062 | for(var i=0; i< numSlides; i++){
1063 | nav.find('ul').append(' ');
1064 | }
1065 |
1066 | //centering it
1067 | nav.css('margin-left', '-' + (nav.width()/2) + 'px');
1068 |
1069 | nav.find('li').first().find('a').addClass('active');
1070 | }
1071 |
1072 | /**
1073 | * Scrolls the slider to the given slide destination for the given section
1074 | */
1075 | $(document).on('click', '.fullPage-slidesNav a', function(e){
1076 | e.preventDefault();
1077 | var slides = $(this).closest('.section').find('.slides');
1078 | var destiny = slides.find('.slide').eq($(this).closest('li').index());
1079 |
1080 | landscapeScroll(slides, destiny);
1081 | });
1082 |
1083 |
1084 | /**
1085 | * Checks for translate3d support
1086 | * @return boolean
1087 | * http://stackoverflow.com/questions/5661671/detecting-transform-translate3d-support
1088 | */
1089 | function support3d() {
1090 | var el = document.createElement('p'),
1091 | has3d,
1092 | transforms = {
1093 | 'webkitTransform':'-webkit-transform',
1094 | 'OTransform':'-o-transform',
1095 | 'msTransform':'-ms-transform',
1096 | 'MozTransform':'-moz-transform',
1097 | 'transform':'transform'
1098 | };
1099 |
1100 | // Add it to the body to get the computed style.
1101 | document.body.insertBefore(el, null);
1102 |
1103 | for (var t in transforms) {
1104 | if (el.style[t] !== undefined) {
1105 | el.style[t] = "translate3d(1px,1px,1px)";
1106 | has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
1107 | }
1108 | }
1109 |
1110 | document.body.removeChild(el);
1111 |
1112 | return (has3d !== undefined && has3d.length > 0 && has3d !== "none");
1113 | }
1114 | };
1115 | })(jQuery);
1116 |
--------------------------------------------------------------------------------