本质上,我需要在滚动到第一部分后停止运行,然后在第一部分的动画完成后再次开始运行。我试过 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');
});
}
}
});
});