I have the following code:
$('body').on('mouseenter', 'img[id$=_fav]', function(event) {
$(this).parent().css("border-top-color", "#000");
});
$('body').on('mouseleave', 'img[id$=_fav]', function(event) {
$(this).parent().css("border-top-color", "gray");
});
I am wondering how can I merge both of those into a single hover event or is this not possible using the 'live' way?
I want something like this:
$('body').on('hover', 'img[id$=_fav]', function(event) {
function(){ //mouse enter
$(this).parent().css("border-top-color", "#000");
}
function(){ //mouse leave
$(this).parent().css("border-top-color", "gray");
}
}