Tanasos
Tanasos

Reputation: 4098

How to target current "stage" of fullpage.js using jQuery

How can I target the current "stage" of fullpage.js ? Meaning - how can I tell jQuery to detect the fourth stage that I have added a class of "homeFour" to?

Here is my markup:

    <div id="fullpage" style="height: 100%; position: relative;" class="fullpage-wrapper">
        <div class="section homeOne fp-section fp-table" style="height: 915px;"><div class="fp-tableCell" style="height:915px;">
        </div></div>
        <div class="section homeTwo fp-section fp-table" style="height: 915px;"><div class="fp-tableCell" style="height:915px;">
        </div></div>
        <div class="section homeThree fp-section fp-table" style="height: 915px;"><div class="fp-tableCell" style="height:915px;">Section Three</div></div>
        <div class="section homeFour fp-section fp-table active fp-completely" style="height: 915px;"><div class="fp-tableCell" style="height:915px;">Section Four</div></div>
    </div>

What I need to do is, tell jQuery that WHEN the section fp-section fp-table active fp-completely has a class of homeFour like so - section homeFour fp-section fp-table active fp-completely to do something else?

So far it activates when I load the page and does not function as expected.

Upvotes: 1

Views: 1142

Answers (1)

Jacques Marais
Jacques Marais

Reputation: 2756

Try something like this:

$('#fullpage').fullpage({
    afterLoad (anchorLink, index, slideAnchor, slideIndex){
        if($(".homeFour").is(".active")){
            // Do stuff
        }
    },
    //...
});

Upvotes: 4

Related Questions