Skip to content

Commit 791de95

Browse files
committed
- Updating version
- Updating dist files
1 parent 5f8ab7b commit 791de95

9 files changed

+93
-66
lines changed

dist/jquery.fullpage.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* fullPage 2.8.1
2+
* fullPage 2.8.2
33
* https://github.com/alvarotrigo/fullPage.js
44
* MIT licensed
55
*
@@ -92,6 +92,9 @@ html.fp-enabled,
9292
overflow: hidden;
9393
position: relative;
9494
}
95+
.fp-scroller{
96+
overflow: hidden;
97+
}
9598
.iScrollIndicator{
9699
border: 0 !important;
97100
}

dist/jquery.fullpage.js

Lines changed: 77 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* fullPage 2.8.1
2+
* fullPage 2.8.2
33
* https://github.com/alvarotrigo/fullPage.js
44
* @license MIT licensed
55
*
@@ -94,10 +94,7 @@
9494
mouseWheel: true,
9595
hideScrollbars: false,
9696
fadeScrollbars: false,
97-
disableMouse: true,
98-
99-
//fixing bug in iScroll with links: https://github.com/cubiq/iscroll/issues/783
100-
click: true
97+
disableMouse: true
10198
};
10299

103100
$.fn.fullpage = function(options) {
@@ -143,6 +140,7 @@
143140
scrollOverflowOptions: null,
144141
touchSensitivity: 5,
145142
normalScrollElementTouchThreshold: 5,
143+
bigSectionsDestination: null,
146144

147145
//Accessibility
148146
keyboardScrolling: true,
@@ -176,8 +174,38 @@
176174
onSlideLeave: null
177175
}, options);
178176

177+
//flag to avoid very fast sliding for landscape sliders
178+
var slideMoving = false;
179+
180+
var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/);
181+
var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints));
182+
var container = $(this);
183+
var windowsHeight = $window.height();
184+
var isResizing = false;
185+
var isWindowFocused = true;
186+
var lastScrolledDestiny;
187+
var lastScrolledSlide;
188+
var canScroll = true;
189+
var scrollings = [];
190+
var controlPressed;
191+
var isScrollAllowed = {};
192+
isScrollAllowed.m = { 'up':true, 'down':true, 'left':true, 'right':true };
193+
isScrollAllowed.k = $.extend(true,{}, isScrollAllowed.m);
194+
195+
//timeouts
196+
var resizeId;
197+
var afterSectionLoadsId;
198+
var afterSlideLoadsId;
199+
var scrollId;
200+
var scrollId2;
201+
var keydownId;
202+
var originals = $.extend(true, {}, options); //deep copy
203+
179204
displayWarnings();
180205

206+
//fixing bug in iScroll with links: https://github.com/cubiq/iscroll/issues/783
207+
iscrollOptions.click = isTouch; // see #2035
208+
181209
//extending iScroll options with the user custom ones
182210
iscrollOptions = $.extend(iscrollOptions, options.scrollOverflowOptions);
183211

@@ -462,34 +490,6 @@
462490
}
463491
};
464492

465-
//flag to avoid very fast sliding for landscape sliders
466-
var slideMoving = false;
467-
468-
var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/);
469-
var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints));
470-
var container = $(this);
471-
var windowsHeight = $window.height();
472-
var isResizing = false;
473-
var isWindowFocused = true;
474-
var lastScrolledDestiny;
475-
var lastScrolledSlide;
476-
var canScroll = true;
477-
var scrollings = [];
478-
var nav;
479-
var controlPressed;
480-
var isScrollAllowed = {};
481-
isScrollAllowed.m = { 'up':true, 'down':true, 'left':true, 'right':true };
482-
isScrollAllowed.k = $.extend(true,{}, isScrollAllowed.m);
483-
var originals = $.extend(true, {}, options); //deep copy
484-
485-
//timeouts
486-
var resizeId;
487-
var afterSectionLoadsId;
488-
var afterSlideLoadsId;
489-
var scrollId;
490-
var scrollId2;
491-
var keydownId;
492-
493493
if($(this).length){
494494
init();
495495
bindEvents();
@@ -754,10 +754,10 @@
754754
*/
755755
function addInternalSelectors(){
756756
//adding internal class names to void problem with common ones
757-
$(options.sectionSelector).each(function(){
757+
container.find(options.sectionSelector).each(function(){
758758
$(this).addClass(SECTION);
759759
});
760-
$(options.slideSelector).each(function(){
760+
container.find(options.slideSelector).each(function(){
761761
$(this).addClass(SLIDE);
762762
});
763763
}
@@ -895,16 +895,24 @@
895895
var scrollDirection = getScrollDirection(currentScroll);
896896
var visibleSectionIndex = 0;
897897
var screen_mid = currentScroll + ($window.height() / 2.0);
898+
var isAtBottom = $body.height() - $window.height() === currentScroll;
899+
var sections = document.querySelectorAll(SECTION_SEL);
900+
901+
//when using `auto-height` for a small last section it won't take most of the viewport
902+
if(isAtBottom){
903+
visibleSectionIndex = sections.length - 1;
904+
}
898905

899906
//taking the section which is showing more content in the viewport
900-
var sections = document.querySelectorAll(SECTION_SEL);
901-
for (var i = 0; i < sections.length; ++i) {
902-
var section = sections[i];
907+
else{
908+
for (var i = 0; i < sections.length; ++i) {
909+
var section = sections[i];
903910

904-
// Pick the the last section which passes the middle line of the screen.
905-
if (section.offsetTop <= screen_mid)
906-
{
907-
visibleSectionIndex = i;
911+
// Pick the the last section which passes the middle line of the screen.
912+
if (section.offsetTop <= screen_mid)
913+
{
914+
visibleSectionIndex = i;
915+
}
908916
}
909917
}
910918

@@ -937,9 +945,11 @@
937945
currentSection.addClass(ACTIVE).siblings().removeClass(ACTIVE);
938946

939947
$.isFunction( options.onLeave ) && options.onLeave.call( leavingSection, leavingSectionIndex, sectionIndex, yMovement);
940-
941948
$.isFunction( options.afterLoad ) && options.afterLoad.call( currentSection, anchorLink, sectionIndex);
949+
950+
stopMedia(leavingSection);
942951
lazyLoad(currentSection);
952+
playMedia(currentSection);
943953

944954
activateMenuAndNav(anchorLink, sectionIndex - 1);
945955

@@ -1000,6 +1010,9 @@
10001010

10011011
lastScroll = currentScroll;
10021012

1013+
//needed for auto-height sections to determine if we want to scroll to the top or bottom of the destination
1014+
previousDestTop = currentScroll;
1015+
10031016
return direction;
10041017
}
10051018

@@ -1302,11 +1315,12 @@
13021315
var position = elemPosition.top;
13031316
var isScrollingDown = elemPosition.top > previousDestTop;
13041317
var sectionBottom = position - windowsHeight + element.outerHeight();
1318+
var bigSectionsDestination = options.bigSectionsDestination;
13051319

13061320
//is the destination element bigger than the viewport?
13071321
if(element.outerHeight() > windowsHeight){
1308-
//scrolling up?
1309-
if(!isScrollingDown){
1322+
//scrolling up?
1323+
if(!isScrollingDown && !bigSectionsDestination || bigSectionsDestination === 'bottom' ){
13101324
position = sectionBottom;
13111325
}
13121326
}
@@ -1520,8 +1534,6 @@
15201534
function afterSectionLoads (v){
15211535
continuousVerticalFixSectionOrder(v);
15221536

1523-
v.element.find('.fp-scrollable').mouseover();
1524-
15251537
//callback (afterLoad) if the site is not just resizing and readjusting the slides
15261538
$.isFunction(options.afterLoad) && !v.localIsResizing && options.afterLoad.call(v.element, v.anchorLink, (v.sectionIndex + 1));
15271539
options.scrollOverflowHandler.afterLoad();
@@ -2082,7 +2094,7 @@
20822094

20832095
//needs scroll?
20842096
if ( contentHeight > scrollHeight) {
2085-
//was there already an scroll ? Updating it
2097+
//did we already have an scrollbar ? Updating it
20862098
if(scrollable.length){
20872099
scrollOverflowHandler.update(element, scrollHeight);
20882100
}
@@ -2599,6 +2611,12 @@
25992611
//reseting the `top` or `translate` properties to 0
26002612
silentScroll(0);
26012613

2614+
//loading all the lazy load content
2615+
container.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){
2616+
$(this).attr('src', $(this).data('src'));
2617+
$(this).removeAttr('data-src');
2618+
});
2619+
26022620
$(SECTION_NAV_SEL + ', ' + SLIDES_NAV_SEL + ', ' + SLIDES_ARROW_SEL).remove();
26032621

26042622
//removing inline styles
@@ -2627,6 +2645,9 @@
26272645
// remove .fp-enabled class
26282646
$('html').removeClass(ENABLED);
26292647

2648+
// remove .fp-responsive class
2649+
$body.removeClass(RESPONSIVE);
2650+
26302651
// remove all of the .fp-viewing- classes
26312652
$.each($body.get(0).className.split(/\s+/), function (index, className) {
26322653
if (className.indexOf(VIEWING_PREFIX) === 0) {
@@ -2766,7 +2787,6 @@
27662787
*/
27672788
onLeave: function(){
27682789
var scroller = $(SECTION_ACTIVE_SEL).find(SCROLLABLE_SEL).data('iscrollInstance');
2769-
27702790
if(typeof scroller !== 'undefined' && scroller){
27712791
scroller.wheelOff();
27722792
}
@@ -2776,7 +2796,7 @@
27762796
afterLoad: function(){
27772797
var scroller = $(SECTION_ACTIVE_SEL).find(SCROLLABLE_SEL).data('iscrollInstance');
27782798
if(typeof scroller !== 'undefined' && scroller){
2779-
scroller.wheelOn();
2799+
scroller.wheelOn();
27802800
}
27812801
},
27822802

@@ -2798,6 +2818,7 @@
27982818
$(this).destroy();
27992819
});
28002820
}
2821+
28012822
iScrollInstance = new IScroll($this.get(0), iscrollOptions);
28022823
iscrollHandler.iScrollInstances.push(iScrollInstance);
28032824
$this.data('iscrollInstance', iScrollInstance);
@@ -2814,10 +2835,12 @@
28142835
*/
28152836
isScrolled: function(type, scrollable) {
28162837
var scroller = scrollable.data('iscrollInstance');
2817-
2838+
2839+
//no scroller?
28182840
if (!scroller) {
2819-
return false;
2841+
return true;
28202842
}
2843+
28212844
if (type === 'top') {
28222845
return scroller.y >= 0 && !scrollable.scrollTop();
28232846
} else if (type === 'bottom') {
@@ -2864,7 +2887,7 @@
28642887
var iScrollInstance = scrollable.data('iscrollInstance');
28652888
iScrollInstance.destroy();
28662889

2867-
scrollable.data('iscrollInstance', 'undefined');
2890+
scrollable.data('iscrollInstance', null);
28682891
}
28692892
element.find(SCROLLABLE_SEL).children().first().children().first().unwrap().unwrap();
28702893
},
@@ -2903,4 +2926,4 @@
29032926
}
29042927
};
29052928

2906-
});
2929+
});

dist/jquery.fullpage.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)