Hello, I hope I can explain this properly. What I am trying to do is add a jQuery mouseover fade in and out effect to the menu, using a background image.
I was able to achieve this fine with CSS no problem, with the example code:
.sf-menu a {
padding:19px 15px 12px 15px;
margin-right: 0;
text-decoration:none;
background: none;
.sf-menu li {
background: none;
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu ul a:focus, .sf-menu a:hover, .sf-menu a:active {
background:url('images/button.png') repeat-x top left;
background-color:#5085c7;
outline: 0;
}
So as you can see, it start with no background, then adds a background after you hover over it, which looks and works fine. But then I decided I wanted that background to fade in and out with the mouse over, so I looked to jQuery. I'm very new to jQuery, but I implemented something that sort of works, but I'm not sure where to go with it next. Here is the code I used:
jQuery(document).ready(function(){
jQuery(".sf-menu li").fadeTo("fast", 0.0);
jQuery(".sf-menu a").fadeTo("fast", 1.0);
jQuery(".sf-menu li").hover(function(){
jQuery(this).fadeTo("fast", 1.0);
},function(){
jQuery(this).fadeTo("fast", 0.0);
});
jQuery(".sf-menu a").hover(function(){
jQuery(this).fadeTo("fast", 1.0);
},function(){
jQuery(this).fadeTo("fast", 1.0);
});
});
Now I know this is the wrong way to implement it, but it starts with the whole menu structure faded out, then when you mouse over it fades in, but I'm not entirely sure how to make just the background fade in and out and not everything, including the text.
Any thoughts or suggestions would be greatly appreciated. Thank you