jlmakes / scrollreveal

Animate elements as they scroll into view.
https://scrollrevealjs.org/
22.33k stars 2.26k forks source link

Multiple options #465

Closed AndrewDawnbringer closed 5 years ago

AndrewDawnbringer commented 5 years ago

Hello there! How to pass multiple options to the constructor, like delay and origin at the same time? I want to merge ScrollReveal().reveal('.yourclass', { delay: 500 }); and ScrollReveal().reveal('.yourclass', { origin: 'left' });. Thanks in advance.

jlmakes commented 5 years ago

ScrollReveal remembers custom options, so these are functionally equivalent:

ScrollReveal().reveal('.yourclass', { delay: 500 });
ScrollReveal().reveal('.yourclass', { origin: 'left' });
ScrollReveal().reveal('.yourclass', {
  delay: 500,
  origin: 'left'
});

Is that the answer you're looking for @AndrewDawnbringer?

AndrewDawnbringer commented 5 years ago

Thank you!