disable onmouseover from menu in

Posted on 2011-10-16
Last Modified: 2012-05-12
i have this menu:

                <asp:Menu ID="Menu1" runat="server" BackColor="#FFFBD6"
                    DynamicHorizontalOffset="2" Font-Names="Verdana" Font-Size="0.8em"
                    ForeColor="#990000" StaticSubMenuIndent="10px" Width="248px">
                    <DynamicHoverStyle BackColor="#990000" ForeColor="White" />
                    <DynamicMenuItemStyle HorizontalPadding="5px" VerticalPadding="2px" />
                    <DynamicMenuStyle BackColor="#FFFBD6" />
                    <DynamicSelectedStyle BackColor="#FFCC66" />
                        <asp:MenuItem Text="    menu0" Value="0"   </asp:MenuItem>
                        <asp:MenuItem Enabled="False" Value="" Selectable="False" Text="<br/>Section1<br/><hr noshade/>"></asp:MenuItem>
                        <asp:MenuItem  Text="    menu1" Value="1"></asp:MenuItem>
                        <asp:MenuItem  Text="    menu2" Value="2"></asp:MenuItem>
                        <asp:MenuItem  Text="    menu3" Value="3></asp:MenuItem>
                    <StaticHoverStyle BackColor="#990000" ForeColor="White" />
                    <StaticMenuItemStyle HorizontalPadding="5px" VerticalPadding="4px"
                        Width="240px" />
                    <StaticSelectedStyle BackColor="#FFCC66" />

now, on the Section1, i don't want the onmouseover event to be fire, so the menu don't change the color of the div, or show any change. only on the others menus.

any idea?
Question by:rafaelrgl
    1 Comment
    LVL 81

    Accepted Solution

    put this in the head section :
    <script language="javascript" type="text/javascript">
        window.onload = function () {
            document.getElementById("<%= Menu1.ClientID %>").getElementsByTagName("a")[0].onmouseover = function (e) {
      	    if (!e) var e = window.event;
    	    e.cancelBubble = true;
    	    if (e.stopPropagation) e.stopPropagation();

    Open in new window

    with jQuery :

    <script language="javascript" type="text/javascript" src=""></script>
    <script language="javascript" type="text/javascript">
            $(document).ready(function () {
                $("a:eq(0)", "#<%= Menu1.ClientID %>").mouseover(function (e) {

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: HTML5 Specialist

    HTML5 development skills are critical to all developers. HTML5 is the foundation to almost any development process. That's why business, design studios, development shops and other organizations need HTML5 developers. Get your foot in the door as a HTML5 specialist.

    Suggested Solutions

    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now