jQuery hovering a div
Posted
by
cxn
on Stack Overflow
See other posts from Stack Overflow
or by cxn
Published on 2012-11-23T16:26:59Z
Indexed on
2012/11/23
17:05 UTC
Read the original article
Hit count: 228
I'm fairly new to jQuery and I really can't get my head around this one.
I'm trying to select <a href="contact"><div id="res">Reserveren</div></a>
.
This is my jQuery code:
$(document).ready(function() {
$('#res').hover(
function () {
$(this).animate({backgroundColor: "#fff" });
},
function () {
$(this).animate({backgroundColor: "#000" });
}
});
However, nothing is working. It doesn't change anything at all... What am I doing wrong?
Thanks in advance, Bart
© Stack Overflow or respective owner