多級菜單CSS+DIV

來源:互聯網
上載者:User

 

 

 

 

html原型

View Code

  • DEMOS

    • zero dollars
    • wrapping text
    • styled form
    • active focus
    • HOVER/CLICK >

      • styled form
      • borders" href="http://www.cnblogs.com/qq4004229/menu/nodots.html">active focus
      • no active/focus borders" href="http://www.cnblogs.com/qq4004229/menu/hover_click.html">hover/click

    • shadow boxing
    • image map
    • fun backgrounds
    • fade scrolling
    • em sized images

  • MENUS

    • spies menu
    • vertical menu
    • enlarging list
    • link images
    • non-rectangular
    • jigsaw links
    • circular links

  • LAYOUTS

    • Fixed 1
    • Fixed 2
    • Fixed 3
    • Fixed 4
    • minimum width

  • BOXES

    • spies menu
    • vertical menu
    • enlarging list
    • link images
    • non-rectangular
    • jigsaw links
    • circular links

  • MOZILLA

    • drop down menu
    • cascading menu
    • content:
    • mozzie box
    • rainbow box
    • snooker cue
    • target practise
    • two tone headings
    • shadow text

  • EXPLORER

    • example one
    • weft fonts
    • vertical align

  • OPACITY

    • opaque colours
    • opaque menu
    • partial opacity
    • partial opacity II
    • < HOVER/CLICK

      • styled form
      • borders" href="http://www.cnblogs.com/qq4004229/menu/nodots.html">active focus
      • no active/focus borders" href="http://www.cnblogs.com/qq4004229/menu/hover_click.html">hover/click

dddddddd

C#下的一個遞迴方法實現

 

 

View Code

DataTable menuTable;
protected void Page_Load(object sender, EventArgs e)
{ litMenu.Text = BuildMenu(menuTable.Select("ParetnId is null"), "");}
/// <summary>
/// 導覽功能表by 趙波2011-3-28
/// </summary>
///
<param name="drs" />
///
<param name="parentStr" />
/// <returns></returns>
public string BuildMenu(DataRow[] drs, string parentStr)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string childMenu = string.Empty;
sb.Append("
<ul>");
     //ParetnId//AccessPath//AccessName
     foreach (var q in drs)
     {
     childMenu = BuildMenu(menuTable.Select("ParetnId=" + q["id"].ToString()), q["id"].ToString());
     if (childMenu.Length &gt; 9)
     {
     string startCss = string.Format("<!--[if lte IE 6]><a class='sub' href='#'>{0}
     <table>
         <tr>
             <td><![endif]-->", q["AccessName"].ToString());
             string endCss = " <!--[if lte IE 6]></td>
         </tr>
     </table>
     </a><![endif]-->";
     sb.AppendFormat("
     <li><a href="http://www.cnblogs.com/qq4004229/admin/%5C%22#%5C%22" class="hide">{0}</a>{2}{1}{3}</li>
     ", q["AccessName"].ToString(), childMenu, startCss, endCss);
     }
     else
     {
     sb.AppendFormat("
     <li><a href="http://www.cnblogs.com/qq4004229/admin/%5C%22%7B1%7D%5C%22">{0}</a></li>
     ", q["AccessName"].ToString(), q["AccessPath"].ToString());
     }
     }
     sb.Append("</ul>
     ");
     return sb.ToString();
     }

 

 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.