Run animation only one time with skrollr

279 views Asked by At

I'm using skrollr to write a website and I need to make some icons appear when the user scrolls the page:

.illustration{
   -skrollr-animation-name: icon;
}

@-skrollr-keyframes icon {
   300-top {
      opacity: 0;
      transform: scale(0.2);
   }
   150-top {
      opacity: 1;
      transform: scale(1);
   }
}

The problem is that I want the icon to appear only one time, so, if the user scrolls up, the icon have not to disappear and then appear again when the user scroll down...

How can I do?

1

There are 1 answers

0
Austin Branham On BEST ANSWER

Use this when initializing:

skrollr.init({
beforerender: function(data) {
    return data.curTop > data.lastTop;
}
});