Blinking an item. (Jquery FadeIn FadeOut ?)
- by 0plus1
I have two divs that I want to make blink at the same time until the user hovers the mouse on one of them.
var shouldiblink = '1';
function mrBlinko(divid){
while (shouldiblink =='1') {
$("#"+divid).fadeIn(100).fadeOut(300);
}
$(document).ready(function(){
mrBlinko("mydiv1");
mrBlinko("mydiv2");
}
The I'll have an hover event that sets shouldiblink to '0'. Problem is that the loops starts as soon as the page is ready and the browser crashes.
I'm stuck with this solution and I can't think of an alternative right now.
Can you help me?
Thank you very much.