Skip to content

Commit f436733

Browse files
committed
- Fixed bug: 1st section wouldn't get active when using scroll bar and fp-auto-height for the 1st section alvarotrigo#2267
1 parent 5090b9b commit f436733

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jquery.fullPage.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* fullPage 2.8.7
2+
* fullPage 2.8.8
33
* https://github.com/alvarotrigo/fullPage.js
44
* @license MIT licensed
55
*
@@ -938,10 +938,14 @@
938938
var isAtBottom = $body.height() - $window.height() === currentScroll;
939939
var sections = document.querySelectorAll(SECTION_SEL);
940940

941-
//when using `auto-height` for a small last section it won't take most of the viewport
941+
//when using `auto-height` for a small last section it won't be centered in the viewport
942942
if(isAtBottom){
943943
visibleSectionIndex = sections.length - 1;
944944
}
945+
//is at top? when using `auto-height` for a small first section it won't be centered in the viewport
946+
else if(!currentScroll){
947+
visibleSectionIndex = 0;
948+
}
945949

946950
//taking the section which is showing more content in the viewport
947951
else{

0 commit comments

Comments
 (0)