Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How override cursor:text in the asp:menu for non-clickable items?

I have a menu control on the master page. The datasource for the menu is a websitemap.

E.g., 
       HOME
            Page1 (clickable)
            Page2
                SubPage1A (clickable)
                SubPage2B
                   SubPageSubPage1 (clickable)
                   SubPageSubPage2 (clickable)
            Page3
                SubPage1C (clickable)

What i want to do is to make clickable(i mean when u click on this link you go to some url) only pages on the bottom level. So, from this example clickable pages would be : Page1, SubPage1A, SubPageSubPage1, SubPageSubPage2 and SubPage1C.

To make other pages non-clickable i remove "url" attribute from the websitemap xml. For now, when i open the page i see the cursor:text style assigned for all non-clickable items (it's 'I') and cursor:pointer (hand) for clickable items.

I know that i can manage cursor styles assigning them for . But that works only for a bunch of items in a hiearchy. But i need to have different cursor styles at the same hierarchy level.

Are there any way to override the cursor:text style by any other for non-clickable items and keep the hand cursor for clickable?

Thanks

like image 831
Sergey Smelov Avatar asked Nov 25 '25 01:11

Sergey Smelov


1 Answers

Menu items with submenus render as a hyperlink with href="#". In the CSS, select those hyperlinks as shown below.

<asp:Menu ...>
    <StaticMenuItemStyle    CssClass="MenuItemClass" />
    <DynamicMenuItemStyle   CssClass="MenuItemClass" />
</asp:Menu>


a.MenuItemClass[href="#"]
{
    cursor: default !important;
}

Tested on FF 3.6.15, Google Chrome 10, Safari 5.0.3, IE 8 and IE 8 in IE7 mode on Windows 7.

like image 127
Doug Domeny Avatar answered Nov 27 '25 22:11

Doug Domeny



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!