javascript - Jquery, changing color on hover -



javascript - Jquery, changing color on hover -

this has been driving me crazy while, cannot figure out doing wrong. trying create 4x4 grid , alter color of each square when hover mouse on (the color stays after mouse leaves) changing color part not working. here have far:

changing color on hover:

this part stuck

$('.square').hover(function () { $(this).addclass('hover'); });

you can remove jquery code adding class hover , create css alter in file

.square:hover { background-color: red; }

simply fixes problem in pure css.

adding jsfiddle http://jsfiddle.net/jjeswin/nb3db/1/

javascript jquery html css

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -