How to get rid of ugly asp:Menu flickering?

后端 未结 12 1217
遥遥无期
遥遥无期 2020-12-24 14:37

I\'m using the asp:Menu control on an ASP.NET 4.0 Webforms page with table-free rendering mode:



        
12条回答
  •  滥情空心
    2020-12-24 15:20

    I also picked up this problem whenever I had a lot going on in the page between the CSS file and the onload event which presumably triggers the javascript to decorate the menu items. Particularly in IE8 this delay for javascript to fix the styling was ugly.

    The solutions from peter and Clearcloud8 were almost good for me. I use this:

    div.menu > ul > li
    { 
        display: inline-block;
        list-style: none; 
    } 
    
    div.menu ul li ul 
    { 
        display: none; 
    }
    

    The main difference being that I used "div.menu > ul > li" which targets only the topmost row of items, instead of "div.menu ul li" which afects the sub-menus also - the result being that the submenu items were not the same width, so they dropped down in a jagged list.

    (I am using Visual Studio 2010, .Net Framework 4)

提交回复
热议问题