:hover is not a DOM element but a status. The css() function of jquery uses inline-css. inline-css can not be applied to a non-existing element.
If you want to change your :hover class's effect, I would using .addClass() to add a class such as alternative-over and style it with css.
A way to do it with pure jQuery could also be to say:
$('a').on("hover", function(){
$(this).css({your styles});
});
A third option is to add css between <style> tags in your DOM through jQuery, though I wouldn't recommend it as it gets messy.
edit: I will try to make an example with your specific code as you've requested, but I'm doing this blindly right now and cannot guarantee it will work right off the bat. A little tweaking might be necessary
//Specify the parents
var obj = $('.openerp .nav-pills > li.active, .openerp .nav-pills > li.active, .openerp a.list-group-item.active, .openerp a.list-group-item.active');
//This makes it grab the "a" within the objects(parents) you've specified before
$('a', obj).on("hover", function(){
//This is what happens when you enter the area with your mouse
$(this).css({'color': res["left_hover_font_color"],'background-color': res["left_hover_bg_color"]});
},
function(){
//this is what happens when your mouse leaves the area (removes the :hover)
$(this).attr("style", ""); //resets the inline-styling
});
^ The above is a pure jQuery way. I myself would use css to get what you want. Adding and removing the class, like so;
//Specify the parents
var obj = $('.openerp .nav-pills > li.active, .openerp .nav-pills > li.active, .openerp a.list-group-item.active, .openerp a.list-group-item.active');
//This makes it grab the "a" within the objects(parents) you've specified before
$('a', obj).on("hover", function(){
//This is what happens when you enter the area with your mouse
$(this).addClass("alternative-hover");
},
function(){
//this is what happens when your mouse leaves the area (removes the :hover)
$(this).removeClass("alternative-hover");
});
res["left_hover_font_color"]?res.left_hover_font_color, but it's a choice.a:hoverfilter in the JQUERY select statement whilea:hoveris not a valid filter