Skip to content

Commit 85683aa

Browse files
committed
- Added support for new extension: reponsiveSlides that turn slides into sections on responsive alvarotrigo#1919
1 parent 57d6592 commit 85683aa

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

jquery.fullPage.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
responsive: 0, //backwards compabitility with responsiveWiddth
164164
responsiveWidth: 0,
165165
responsiveHeight: 0,
166+
responsiveSlides: false,
166167

167168
//Custom selectors
168169
sectionSelector: SECTION_DEFAULT_SEL,
@@ -487,6 +488,10 @@
487488
$(SECTION_NAV_SEL).hide();
488489
$body.addClass(RESPONSIVE);
489490
$.isFunction( options.afterResponsive ) && options.afterResponsive.call( container, active);
491+
492+
if(options.responsiveSlides && FP.responsiveSlides){
493+
FP.responsiveSlides.toSections();
494+
}
490495
}
491496
}
492497
else if(isResponsive){
@@ -495,6 +500,10 @@
495500
$(SECTION_NAV_SEL).show();
496501
$body.removeClass(RESPONSIVE);
497502
$.isFunction( options.afterResponsive ) && options.afterResponsive.call( container, active);
503+
504+
if(options.responsiveSlides && FP.responsiveSlides){
505+
FP.responsiveSlides.toSlides();
506+
}
498507
}
499508
};
500509

@@ -508,7 +517,10 @@
508517
lazyLoad: lazyLoad,
509518
addAnimation: addAnimation,
510519
performHorizontalMove: performHorizontalMove,
511-
silentLandscapeScroll: silentLandscapeScroll
520+
silentLandscapeScroll: silentLandscapeScroll,
521+
keepSlidesPosition: keepSlidesPosition,
522+
silentScroll: silentScroll,
523+
styleSlides: styleSlides
512524
}
513525
};
514526
};
@@ -519,6 +531,7 @@
519531
loadExtension('fp_scrollHorizontallyExtension');
520532
loadExtension('fp_resetSlidersExtension');
521533
loadExtension('fp_interlockedSlidesExtension');
534+
loadExtension('fp_responsiveSlidesExtension');
522535

523536
init();
524537

@@ -1260,7 +1273,7 @@
12601273
//emptying the array, we dont care about old scrollings for our averages
12611274
scrollings = [];
12621275
}
1263-
1276+
12641277
if(canScroll){
12651278
var averageEnd = getAverage(scrollings, 10);
12661279
var averageMiddle = getAverage(scrollings, 70);
@@ -2222,7 +2235,10 @@
22222235
}
22232236

22242237
function addTableClass(element){
2225-
element.addClass(TABLE).wrapInner('<div class="' + TABLE_CELL + '" style="height:' + getTableHeight(element) + 'px;" />');
2238+
//In case we are styling for the 2nd time as in with reponsiveSlides
2239+
if(!element.hasClass(TABLE)){
2240+
element.addClass(TABLE).wrapInner('<div class="' + TABLE_CELL + '" style="height:' + getTableHeight(element) + 'px;" />');
2241+
}
22262242
}
22272243

22282244
function getTableHeight(element){

0 commit comments

Comments
 (0)