Question

i created a maze and i want to set an event(or what it takes) that when user mouse leave (after he failed) it will clear the colored way for he can start over again

  $(".way").bind('mouseenter', function() {
  $('#highlight_lose').fadeIn(400);
})

here is the fiddle link:

http://jsfiddle.net/uqcLn/8/

Was it helpful?

Solution

Add $(".wall").css("background",'#fff'); to #highlight_lose and #finish

$('#highlight_lose').bind('mouseleave', function() {
$(this).fadeOut(400);  
$(".wall").css("background",'#fff'); 
})

$('#finish').bind('mouseenter', function() {
$('#highlight_win').fadeIn(400); 
$(".wall").css("background",'#fff'); 
})

http://jsfiddle.net/uqcLn/22/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top