Could use some assistance with the .css()
method in jQuery.
Currently working on a mouseover css menu, and encountering an issue when trying to include this code:
$(this).siblings().css({backgroundColor:"#eee"});
at the end of my script. It seems to interfere with my mouseover function.
$(".principal").click(function()
{
$(this).css({backgroundColor:"#861b1b"}).next("div.menu_body").slideToggle(300).siblings("div.menu_body").slideUp("slow");
$(this).siblings().css({backgroundColor:"#eee"});
});
The problem I'm facing is that while my menu functions with css :hover, I need to revert the P color to gray. Is there a solution to address this issue?
<div>
<span>Ventanas</span>
<p class="principal">Fijas</p>
<div class="menu_body">
<a href="products.php?ref=fijo&tipo=7001ad">Normal (7001)</a>
<a href="products.php?ref=fijo&tipo=7001ad">Normal (7001)</a>
<a href="products.php?ref=fijo&tipo=7001ad">Normal (7001)</a>
<a href="products.php?ref=fijo&tipo=7001ad">Normal (7001)</a>
</div>
</div>
div.sdmenu div p {
cursor:pointer;
padding: 5px 10px;
background: #eee;
display: block;
border-bottom: 1px solid #ddd;
color:#000;
text-decoration:none;
margin: 0;
}
div.sdmenu div p:hover {
background:#841c1c;
color: #fff;
text-decoration: none;
}