Reputation: 1
hecked up trying a onmouseover background image change event for a link in a jquery site, if anyone knows it, please answer this with a demo!
Upvotes: 0
Views: 1157
Reputation: 2853
Assumption: you have a transparent background image like the one in this example.
Working demo at: http://jsfiddle.net/marcosfromero/Bytmn/
$('#logo').hover(function() {
$(this).addClass('highlighted');
}, function() {
$(this).removeClass('highlighted');
});
You'll need an image with logo
id and a CSS rule for the highlighted
class.
jQuery hover
expects two functions to be called:
mouseenter
event)mouseleave
event)Upvotes: 5
Reputation: 12508
a
{
background:#ffffff url('path-of-your-mouseout-image.jpg') no-repeat top left;
}
a:hover
{
background:#ffffff url('path-of-your-mouseover-image.jpg') no-repeat top left;
}
CSS CAN DO IT BUDDY.
Upvotes: 2