So I want to animate and display a menu on an element hover or when certain time has passed without a hover.
This I what I’ve got but it doesn’t work.
var didAnimationStart = 0;
$(document).ready(function() {
$('#logoi').hover(startAnimation());
var t = setTimeout("if (didAnimationStart==0) startAnimation();",10000);
});
function startAnimation()
{
didAnimationStart = 1;
$('.linea').animate({
width: "93%",
}, 3000 );
$('.menu-txt').animate({
opacity: "1",
}, 2500 );
}
Try this:
I got rid of the
()in this line:$('#logoi').hover(startAnimation);