Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I recently enabled the dynamic menu functions for my SharePoint 2010 site by following the directions from this Microsoft TechNet page. The problem I am running into now is that when you hover over the Quick Launch link, the resulting group of links appears with a transparent background which can be impossible to read if there is text on the main portion of the page.

Is it possible to change the flyout menu's background? And if so, how?

share|improve this question
add comment

7 Answers 7

up vote 2 down vote accepted

Bob - This is not so much an answer as a point in the right direction. I don't have the menus enabled so cannot tell you exactly what tags to look for. What you need to do is use the IE Developers Toolbar or a similar tool to identify the style associated with the background color on the menu. Then using jQuery, you can write a few lines of javascript to change the color when the page is loading. The script would be similar to this: http://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_css_change_p.

The jQuery can be added to your master page, or added in a hidden content editor web part on your page.

share|improve this answer
    
What kind of event should I try to set the background color to? On document load, when the parent item is highlighted, etc? –  Psycho Bob Aug 23 '10 at 19:19
1  
This function fires when the DOM is loaded: $(document).ready(function(){ } If it is a one time thing (page load), you would want to code it in this method. I haven't looked at the flyout menu in detail, but I'm assuming it is doing a transformation on hover. If so, then setting the background color in the function mentioned above should be fine. –  Rob Wilson Aug 23 '10 at 19:30
1  
Finally got it working by changing the background color of the Unordered Lists with 'dynamic' set as the class. Thanks for your help! –  Psycho Bob Aug 31 '10 at 20:47
add comment

I'm just providing the code here in case anyone is looking for a 'copy and paste' solution.

$(document).ready(function(){
     $("ul.dynamic").css("background-color","COLOR");
});

EDIT: I should have stated that I accomplished this by using jQuery.

share|improve this answer
add comment

I think pure css would be a much lighter approach for a similar result. For example:

<style type="text/css">ul.dynamic {background-color:lightblue!important;}</style>
share|improve this answer
    
I think you are probably right that just editing the CSS would have been the easiest way. Though setting up jQuery now will enable us to use it for other things down the road. –  Psycho Bob Sep 7 '10 at 16:58
add comment

I got this to work by editing the corev4.css and adding the background-color element to

.s4-ql ul.root ul > li > a{

share|improve this answer
    
This css worked for the background of the flyout on the Quick Launch. Added to custom master page. –  Jason Jones Jul 22 '11 at 14:09
add comment

I placed a call to Microsoft and their answer was to edit the v4.master. they created the following code and placed it in the top section at the end of section titled "head" starting at line 34 this is the code they provided:

<style>
.menu-item
{
background-color:white;
}
</style>

you can change the color to match the color of your site. Once you have made this edit just check the page back in and approve it. This will put a border around the entire flyout menu not just the individual items, it make the flyouts look like the top navagation menu.

share|improve this answer
add comment

This works

/* the submenu background color on hover */
.s4-tn li.dynamic > a:hover {
    font-weight:normal;
    background-color: yellow;   
}

but I can't change the text color on hover...and yes I have tried color: green !important;

Any ideas?

share|improve this answer
    
foreground-color: green; –  Mike Nov 30 '12 at 18:45
add comment

This is how I'm doing it in corev4.css (located in hive):

.s4-ql ul.root ul > li > a{
padding:3px 4px 4px 10px;
border-width:1px 0px;
border-style:solid;
border-color:transparent;
/* Added */ background-color:#0099ff;
/* [ReplaceColor(themeColor:"Dark1")] */ color:white;
overflow-x:hidden;
display:block;
zoom:1;
}

.s4-ql ul.root ul > li > a:hover{
/* [ReplaceColor(themeColor:"Accent1-Darker")] color:#44aff6; */ color:white;
/* Added */ background:#ccebff url('http://my.sharepoint.com/Images1/Menu_Hover_Background.png') repeat-x left top;
/* Replaced text-decoration:underline; */  text-decoration:none;
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.