Skip to content

Commit 3a4a9f3

Browse files
authored
Revert "Offset top option"
1 parent 233c753 commit 3a4a9f3

File tree

2 files changed

+3
-12
lines changed

2 files changed

+3
-12
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,6 @@ $(document).ready(function() {
202202
responsiveWidth: 0,
203203
responsiveHeight: 0,
204204
responsiveSlides: false,
205-
offsetTop: 0,
206205

207206
//Custom selectors
208207
sectionSelector: '.section',
@@ -474,8 +473,6 @@ In order to prevent fullpage.js from creating the scrollbar in certain sections
474473

475474
- `responsiveSlides`: (default `false`) [Extension of fullpage.js](http://alvarotrigo.com/fullPage/extensions/). When set to `true` slides will be turned into vertical sections when responsive mode is fired. (by using the `responsiveWidth` or `responsiveHeight` options detailed above). Requires fullpage.js >= 2.8.5.
476475

477-
- `offsetTop`: (default `0`). When set to a numeric value, this defines a top offset for the container height. This is particularly useful if you have a fixed header navigation that follows your scroll and you do not want the header navigation to cut off content in your sections.
478-
479476
- `lazyLoading`: (default `true`) Lazy loading is active by default which means it will lazy load any media element containing the attribute `data-src` as detailed in the [Lazy Loading docs](https://github.com/alvarotrigo/fullPage.js#lazy-loading) . If you want to use any other lazy loading library you can disable this fullpage.js feature.
480477

481478
## Methods

jquery.fullPage.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,6 @@
167167
responsiveWidth: 0,
168168
responsiveHeight: 0,
169169
responsiveSlides: false,
170-
offsetTop: 0,
171170

172171
//Custom selectors
173172
sectionSelector: SECTION_DEFAULT_SEL,
@@ -192,7 +191,7 @@
192191
var isTouchDevice = navigator.userAgent.match(/(iPhone|iPod|iPad|Android|playbook|silk|BlackBerry|BB10|Windows Phone|Tizen|Bada|webOS|IEMobile|Opera Mini)/);
193192
var isTouch = (('ontouchstart' in window) || (navigator.msMaxTouchPoints > 0) || (navigator.maxTouchPoints));
194193
var container = $(this);
195-
var windowsHeight = $window.height() - options.offsetTop;
194+
var windowsHeight = $window.height();
196195
var isResizing = false;
197196
var isWindowFocused = true;
198197
var lastScrolledDestiny;
@@ -438,7 +437,7 @@
438437

439438
isResizing = true;
440439

441-
windowsHeight = $window.height() - options.offsetTop; //updating global var
440+
windowsHeight = $window.height(); //updating global var
442441

443442
$(SECTION_SEL).each(function(){
444443
var slidesWrap = $(this).find(SLIDES_WRAPPER_SEL);
@@ -538,11 +537,6 @@
538537
options.css3 = support3d();
539538
}
540539

541-
if (options.offsetTop) {
542-
container.css("top", options.offsetTop);
543-
container.height(container.height() - options.offsetTop);
544-
}
545-
546540
options.scrollBar = options.scrollBar || options.hybrid;
547541

548542
setOptionsFromDOM();
@@ -654,7 +648,7 @@
654648
$('html').addClass(ENABLED);
655649

656650
//due to https://github.com/alvarotrigo/fullPage.js/issues/1502
657-
windowsHeight = $window.height() - options.offsetTop;
651+
windowsHeight = $window.height();
658652

659653
container.removeClass(DESTROYED); //in case it was destroyed before initializing it again
660654

0 commit comments

Comments
 (0)