Fullpage.js: Detect the first and last slide (Unknown number of slideshow) and freeze prev and next button

Created on 4 Dec 2014  ·  1Comment  ·  Source: alvarotrigo/fullPage.js

Hello, I have two buttons "previous" and "next". I can't detect the length of the slider to freeze previous button when i'm at the first slide and the Next button at the end of slide.
I've looked the documentation but I have not seen any function related to this problem. :(
Anyone can help me please ?

Thanks a lot

question

Most helpful comment

That's mainly about jQuery knowledge.

You can get the active section with:

$('.fp-section.active')

The index of the active horizontal slide with:

$('.fp-section.active .fp-slide.active').index();

Then to get the number of slides.in the active section:

$('.fp-section.active .fp-slide').length;

If you compare the active slide index with the number of sections, or with 0, then you will be able to know if you are in the 1st or the last slide.

>All comments

That's mainly about jQuery knowledge.

You can get the active section with:

$('.fp-section.active')

The index of the active horizontal slide with:

$('.fp-section.active .fp-slide.active').index();

Then to get the number of slides.in the active section:

$('.fp-section.active .fp-slide').length;

If you compare the active slide index with the number of sections, or with 0, then you will be able to know if you are in the 1st or the last slide.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Sperziemone picture Sperziemone  ·  5Comments

mxnvkv picture mxnvkv  ·  4Comments

lunaandyou picture lunaandyou  ·  4Comments

pigerla picture pigerla  ·  4Comments

meceware picture meceware  ·  3Comments