alvarotrigo / fullPage.js

fullPage plugin by Alvaro Trigo. Create full screen pages fast and simple
http://alvarotrigo.com/fullPage/
GNU General Public License v3.0
35.25k stars 7.3k forks source link

Start afterLoad animation earlier when responsive #3451

Open elli-pirelli opened 5 years ago

elli-pirelli commented 5 years ago

Hi, I've added animations to all sections using afterLoad. However in the responsive version, the animations does not start before you scroll about 50% of the site. Is there a way to change that? I have tried using on onLeave but had the same problem.

$('#fullpage').fullpage({
    anchors: ['firstPage', 'secondPage'],
    autoScrolling: true,
    responsive: 992,
    scrollBar: true,
    lazyLoading: true,
    hybrid:true,
    easing: 'easeInOutCubic',
    easingcss3: 'ease',
    showActiveTooltip: 'true',
    css3: true,

    afterLoad: function(anchorLink, index){
                   if(index == 2){
            $('#one').addClass('animated');
            $('#two').addClass('animated');     
        }
             }
 });

Versions

This happens on all responsive versions I tested. Mobile up to 992px

alvarotrigo commented 5 years ago

There's no option for that at the moment! Thanks for pointing it out anyways! I'll mark it as a possible enhancement!

Meanwhile, you can use other library to fire those animations on responsive, such as scrollReveal

elli-pirelli commented 5 years ago

Thank you for the quick reply!