Closed kylemilloy closed 5 years ago
Use case would be if you have a countup that's below the fold that you don't want to countup right away. So you'd do something like
<count-up :end-val="100" :start-on-mount="false" @ready="onReady" />
onReady(countUp) {
window.addEventListener('scroll', evt => {
evt.pageY > countUp.target.getBoundingClientRect().top ? countUp.start() : null;
});
}
use delay
option.
@xlsdg delay
option only delays by time. What if you want logic to control when the animation should start? I.E. when the countup component scrolls into view.
@mcking49 set delay
to -1
, when the countup component scrolls into view, call instance.start()
.
@xlsdg Cool. There is no documentation regarding using -1
as the delay
value. Would be good to add.
I have same issue. Can you share any live example?
This is a fix for #16