本文介绍了如何锁定当前的“阶段”使用jQuery的fullpage.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何定位 的当前阶段?含义 - 如何告诉jQuery检测我已经添加了一类homeFour的第四阶段?



这是我的标记:

 < div id =fullpagestyle =height:100%; position:relative ;类=全页的包装器> 
< div class =section homeOne fp-section fp-tablestyle =height:915px;>< div class =fp-tableCellstyle =height:915px;>
< / div>< / div>
< div class =section homeTwo fp-section fp-tablestyle =height:915px;>< div class =fp-tableCellstyle =height:915px;>
< / div>< / div>
< div class =section homeThree fp-section fp-tablestyle =height:915px;>< div class =fp-tableCellstyle =height:915px;> Section三个< / DIV>< / DIV>
< div class =section homeFour fp-section fp-table active fp-completestyle =height:915px;>< div class =fp-tableCellstyle =height:915px; >第四节< / div>< / div>
< / div>

我需要做的是,告诉jQuery什么时候部分fp- section fp-table active fp-complete 有一类homeFour就像这样 - section homeFour fp-section fp-table active fp-complete 要做的事情其他什么?



到目前为止,当我加载页面并且无法按预期运行时它会激活。

尝试这样的事情:

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


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.

解决方案

Try something like this:

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

这篇关于如何锁定当前的“阶段”使用jQuery的fullpage.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 22:57