Hey there! I'm currently working on a webpage and utilizing the Transit library for 3D rotations and other CSS transformations. On this page, I have three links that are set to scale up by 1.2 times when hovered over. Everything seems to be working well until I quickly move my mouse back and forth over the link multiple times. Instead of the animation occurring just once, it plays repeatedly based on how many times I hover over it. How can I ensure that regardless of how many times the mouse interacts with the div, the animation only occurs once (sort of like a prolonged hover effect)?
Do you get what I mean?
Here's the website link: LINK
Below is the jQuery code snippet:
//Just so you know, the ID of the div is "rotater"
$(function(){
$('#background').hide();
$( "#banner").hide();
$( "#rotater").hide();
$( ".tab" ).hide();
$( ".content" ).hide();
$( "#share" ).hide();
$( ".sidenav").hide();
$("#navigation").animate({top:"100%"});
window.setTimeout(function(){$('#banner').fadeIn('slow');$("#navigation").animate({top:"0"});
$('#background').fadeIn('slow');
$("#rotater").fadeIn("fast").transition({rotateY:360, duration:3000});
$( "#share" ).fadeIn("slow");$(".sidenav").fadeIn("slow");
$("#ha").animate({top:"25%",left:"3%"});$("#do").animate({top:"45%",left:"3%"});
$("#set").animate({top:"65%",left:"3%"});$("#net").animate({top:"25%",left:"75%"});
$("#dasu").animate({top:"65%",left:"75%"});}, 1000);
$( ".sidenav" ).hover(function(){$("#"+this.id).transition({scale:1.2});}, function(){$("#"+this.id).transition({scale:1});}); // THIS IS THE CODE IN QUESTION
$( "#share" ).hover(function(){$( "#share" ).animate({left:"0%"});}, function(){$( "#share" ).animate({left:"-15%"});});
var cw = $('#rotater').width();
$('#rotater').css({'height':cw+'px'});
setInterval(function(){$("#rotater").transition({rotateY:'+=360deg', duration:3000});},10000);
});
$(window).load(function() {
$(".loader").fadeOut("slow");
})