This is a migrated thread and some comments may be shown as answers.

hovering a menu item

2 Answers 60 Views
Menu
This is a migrated thread and some comments may be shown as answers.
giancarlo
Top achievements
Rank 1
giancarlo asked on 28 May 2009, 02:08 PM
How do i change the color of my custom skin  so when i hover a menu item the text color changes?

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 29 May 2009, 06:06 AM
Hello,

You can try out  the following code to set a text color for menu items on hovering:
c#:
 protected void RadMenu1_PreRender(object sender, EventArgs e) 
    { 
        foreach (RadMenuItem item1 in RadMenu1.Items) 
        { 
            item1.Attributes.Add("onmouseover""this.style.color='red'"); 
            item1.Attributes.Add("onmouseout""this.style.color=''"); 
            foreach (RadMenuItem childItem in item1.Items) 
            { 
                childItem.Attributes.Add("onmouseover""this.style.color='red'"); 
                childItem.Attributes.Add("onmouseout""this.style.color=''"); 
 
            } 
        }  

You can also try out the following CSS for changing the mousehover color of menuitem.
CSS:
 
<style type="text/css">    
.RadMenu_SkinName .rmLink:hover   
{  
     colorred !important;  
}  
 </style>  
Note: Change the SkinName to the name of custom skin that you are using.

Thanks
Princy.
0
Princy
Top achievements
Rank 2
answered on 29 May 2009, 06:06 AM

Tags
Menu
Asked by
giancarlo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or