I have an asp.net menu with multiple menuitems. How can I overlay an image over the menu item text when the mouse is over the item? Secondly, how can I display a different ov开发者_开发问答erlay image when the menu item is selected?
Thanks
You can achieve what you are trying to do by using the various MenuItemStyles like so:
<asp:Menu ID="menu" runat="server">
<DynamicSelectedStyle CssClass="menu-item-selected" />
<StaticSelectedStyle CssClass="menu-item-selected" />
<StaticHoverStyle CssClass="menu-item-hover" />
<DynamicHoverStyle CssClass="menu-item-hover" />
<Items>
<asp:MenuItem Text="Item 1" Selectable="true" Selected="true"></asp:MenuItem>
<asp:MenuItem Text="Item 2" Selectable="true"></asp:MenuItem>
<asp:MenuItem Text="Item 3" Selectable="true"></asp:MenuItem>
</Items>
</asp:Menu>
Hope this helps.
精彩评论