Scrollify +自定义滚动事件

时间:2017-03-01 23:28:04

标签: jquery jquery-scrollify

基本上,我需要scrollify一旦到达第一部分就停止运行,然后在第一部分的动画完成后再次开始运行。我试过stop();但没有运气。非常感谢任何帮助。

$(function() {
$('.section-image1').hide();
$('.section-image2').hide();
$('.section-image3').hide();
$.scrollify({
    section: ".header-home",
    section: ".section",
    before: function(section){
        console.log(section);
        if(section==1){
            //stop scrollify
            $(window).scroll(function(){

                $('.section-image1').show();
                $('.section-image2').show();
                $('.section-image3').show();
                $('.section-image1').addClass('fadeInUp');
                $('.section-image2').addClass('fadeInUp');
                $('.section-image3').addClass('fadeInUp');
        });
            //start scrollify
            if(section==2){
            //stop scrollify
            $(window).scroll(function(){

                $('.section-image4').show();
                $('.section-image5').show();
                $('.section-image6').show();
                $('.section-image4').addClass('fadeInUp');
                $('.section-image5').addClass('fadeInUp');
                $('.section-image6').addClass('fadeInUp');
        });
    }

}
});
});

0 个答案:

没有答案