开发者

ASP.NET Menu Item hover image

开发者 https://www.devze.com 2023-03-31 16:11 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消