Hello, I want to execute a TimelineLite only one time.
I use a plugin (fullPage) and when I move to a section of the page 'secondPage', I have a function for executing the TimelineLite( animaFotos() ).
But I need the animation only works one time. I've tried with kill method but doesn´t work the animation.
function animaFotos(){
//cambio css. para mostrar imágenes y comenzar TwenLite
fotos.css('visibility', 'visible');
textoinfo.css('visibility', 'visible');
tl
.from(foto1, 0.3,{y:-10, autoAlpha:0,ease:Power1.easeOut},0.3)
.from(foto2, 0.3,{y:-10, autoAlpha:0,ease:Power1.easeOut},0.6)
.from(foto3, 0.3,{y:-10, autoAlpha:0,ease:Power1.easeOut},0.9)
.from(textoinfo, 0.3,{y:-10, autoAlpha:0,ease:Power1.easeOut},1.2);
}
$(document).ready(function() {
$('#fullpage').fullpage({
css3:false,
anchors: ['firstPage', 'secondPage','thirdPage', 'lastPage'],
afterLoad: function(anchorLink, index){
var loadedSection = $(this);
//using index
if(index == 1){
animaLogo();
}
//using anchorLink
if(anchorLink == 'secondPage'){
$('#titulo').html('bio');
animaFotos();
secondLife2('.foto1','img/prueba1.jpg', 'img/1.jpg');
secondLife2('.foto2','img/prueba1.jpg', 'img/4.jpg');
secondLife2('.foto3','img/prueba1.jpg', 'img/3.jpg');
}
if(anchorLink == 'thirdPage'){
$('#titulo').html('portfolio');
animaCards();
}
if(anchorLink == 'lastPage'){
$('#titulo').html('contacta');
alert('contacto');
animaCards();
}
}
});
});