Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion jquery.fullPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
scrollOverflow: false,
touchSensitivity: 5,
normalScrollElementTouchThreshold: 5,
topOffset: 0,

//Accessibility
keyboardScrolling: true,
Expand Down Expand Up @@ -245,6 +246,13 @@
options.lockAnchors = value;
};

/**
* Sets topOffset variable
*/
FP.setTopOffset = function(value){
options.topOffset = value;
};

/**
* Adds or remove the possiblity of scrolling through sections by using the mouse wheel or the trackpad.
*/
Expand Down Expand Up @@ -1202,7 +1210,7 @@
if(typeof dest === 'undefined'){ return; } //there's no element to scroll, leaving the function

//auto height? Scrolling only a bit, the next element's height. Otherwise the whole viewport.
var dtop = element.hasClass(AUTO_HEIGHT) ? (dest.top - windowsHeight + element.height()) : dest.top;
var dtop = element.hasClass(AUTO_HEIGHT) ? ( dest.top - windowsHeight + element.height() + options.topOffset ) : ( dest.top + options.topOffset );

//local variables
var v = {
Expand Down