Hi!
Can someone help me, i can't find error.
I want to create simple animation with hide/show some div's using jQuery and GSAP
Everything work well but in console i have error: Uncaught Cannot tween a null target.
$(document).ready(function ($) {
if($('#teamBio').length){
var bioText = $('.bioText'),
teamBtns = $('.btns'),
longBio = bioText.find('.longBio'),
certBio = bioText.find('.certBio'),
shortBio = bioText.find('.shortBio');
teamBtns.each(function(i){
var tl_blocks = new TimelineMax({paused:true});
tl_blocks
.fromTo(teamBtns[i], 0.3, {width:"40%", autoAlpha:1}, { width: "0%", autoAlpha:0})
.fromTo(bioText[i], 0.3, {width:"60%"}, { width:'100%'}, "-=0.3")
.to(shortBio[i], 0.3, {autoAlpha:0, display:"none"})
.to([longBio[i], certBio[i]], 0.3, {display:"block", autoAlpha:1});
$(this).click(function(){
tl_blocks.play();
return false;
})
});
}
});