Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove background color attribute from css onmouseover using JQuery

I'm trying to remove background color of a div onmouseover.

$("#LoginTab").mouseover(function(){
    //Gives me white color
    $("#LoginTab").animate({backgroundColor: ''},1000); 
});
$("#LoginTab").mouseout(function(){
    $("#LoginTab").animate({'backgroundColor':'#babfde'},1000);
});

Here is the CSS

#LoginTab
{
    background-color:#babfde;
    padding-top:5px;
    padding-bottom:5px;
    opacity:1;
    border:#babfde 2px solid;
}

So the effect I want is that background color will be removed which will give me only border and stuff inside that div onmouseover

like image 614
Prodeep Chatterjee Avatar asked Jul 04 '13 04:07

Prodeep Chatterjee


1 Answers

You need to use transparent, empty string isn't a valid background color.

Also you could just do it with css using a hover flag:

#LoginTab:hover
{
    background-color: transparent;
}
like image 170
Seth McClaine Avatar answered Sep 28 '22 23:09

Seth McClaine