Greetings All,
I am a new Greensock user and I absolutely love this code! I have been working on a simple animated mobile website, and I want to include a simple progress bar (not necessarily a slider or scubber) that runs in time with the animation. I have been trying to accomplish this as follows, but it does not work:
<script type="text/javascript">
$(window).load(function() {
var unleash_tl = new TimelineMax({onUpdate:progressBar});
//slideOne
unleash_tl.to("
Hi, I'm trying the quoted code.
function progressBarUpdate(tween) {
console.log(tween.progress())
}
const tl = gsap.timeline({
delay: 1,
onUpdate: progressBarUpdate,
});
tl
.add(animate())
.add(reveal(), 'reveal')
.add(start())
The timeline itself works perfectly. I just added onUpdate: progressBarUpdate and the function, and I get this error:
The problem comes from this line console.log(tween.progress())
Any idea?