2015-03-31 164 views
0

我在HTML一個初學者,需要從你們如何添加子下拉菜單

一些幫助,我想補充子下拉菜單,在教程下拉菜單中,我有三個主要的下拉菜單,分別是:HTML5,CSS ,JQuery的

現在我想顯示兩個子菜單即:在HTML 5下拉菜單下載和視頻

<div class="collapse navbar-collapse navbar-right navbar-main-collapse"> 
<ul class="nav navbar-nav"> 
    <li class="active"><a href="#intro">Home</a></li> 
    <li><a href="#about">About</a></li> 
    <li><a href="#service">Service</a></li> 
    <li><a href="#contact">Contact</a></li> 
    <li class="dropdown"> 
    <a href="#" class="dropdown-toggle" data-toggle="dropdown">Tutorials<b class="caret"></b></a> 
    <ul class="dropdown-menu"> 
    <li><a href="#">HTML 5</a></li> 
     <!-- here i would like to show two sub dropdown menus, first Downlo ads and second Videos --> 
    <li><a href="#">CSS</a></li> 
    <li><a href="#">JQuery</a></li> 
    </ul> 
</li> 
</ul> 
</div> 
+0

我寫過上面的腳本 – MCJ 2015-03-31 04:38:26

回答

0

你將不得不使用與SelectedIndexChanged事件另一個下拉時觸發第二dropdownlist.Something像這樣:

<asp:DropDownList ID="DropDownList1" runat="server" onselectedindexchanged="DropDownList1_SelectedIndexChanged" Width="224px" 
    AutoPostBack="True" AppendDataBoundItems="true"> 
<asp:DropDownList ID="DropDownList2" runat="server" 
    onselectedindexchanged="DropDownList2_SelectedIndexChanged"> 
</asp:DropDownList> 


protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) 
{ 
//Load DropDownList2 

} 

由於您還沒有發佈您的代碼,couldnt幫助你更多。