I am trying to run some code that will start a particular animation when my timer stops, but I am stuck on trying to get it started.
Code:
if($('#popup_msg').length) {
var timer = 0;
$('#popup_msg').bind({
mouseenter: function() {
timer = 0;
console.log(timer);
},
mouseleave: function(){
timer += 100;
console.log(timer);
}
});
timer += 100;
console.log(timer);
if(timer == 5000) {
$('#popup_msg').delay(5000).slideUp();
}
}
Thanks in advance for the help!
I was able to figure it out using the following code
if you know of a better way of doing this, please let me know!