-1

i creat a maze and don't know why on hover not working will be happy for any help

$('.wall')
.bind('mouseenter', function() {
    $(this).css({
        'background-color': 'green'
    });
})

here is the fiddle link:

http://jsfiddle.net/uqcLn/6/

alonblack
  • 925
  • 2
  • 13
  • 31
  • You have to include the jQuery library to use its functions. – Musa Oct 05 '13 at 00:44
  • You didn't include jQuery, it works once it's added - http://jsfiddle.net/uqcLn/7/. In future try checking your browser's console for errors: http://stackoverflow.com/questions/4743730/what-is-console-log-and-how-do-i-use-it – Joe Oct 05 '13 at 00:44
  • see http://jsfiddle.net/vYt9Q/1/ – Arun P Johny Oct 05 '13 at 00:46

1 Answers1

2

use this in jsfiddle:

in html add this:

<script type="text/javascript" src="http://codeorigin.jquery.com/jquery-1.10.2.min.js"></script>

and in script do this:

$(document).ready(function(){
    $(document).on("mouseenter",".wall",function(){
     $(this).css({
            'background-color': 'green'
        });
    });
    $(document).on('mouseleave',".wall", function () {
        $(this).css({
           'background-color': ''
        });
    });
});
Hugo Tostes
  • 412
  • 4
  • 13