我试图将一个按钮放在一个web表单中,当我点击它的子菜单会出现给我其他选项来导航我的应用程序。有什么办法吗?
试试:http://jsfiddle.net/MXkCb/
<input type="button" value="show more options" class="showmore"/>
<div><ul>
<li>option 1</li>
<li>option 2</li>
<li>option 3</li>
<li>option 4</li>
</ul></div>
$('.showmore').on('click', function(){
$('div').show("slow");
});
在您的视图中,尝试如下:
@ {var cultureItems = locoptions . value . supporteducultures.Select (c =比;new SelectListItem {Value = c.Name, Text = c.TwoLetterISOLanguageName})
.ToList ();}
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle waves-effect waves-light" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown title
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
@foreach (var culture in cultureItems)
{
<form id="selectLanguage" asp-controller="Home"
asp-action="SetLanguage" asp-route-returnUrl="@Context.Request.Path"
method="post" class="form-horizontal" role="form">
<input class="dropdown-item waves-effect waves-light" type="submit" name="culture" value="@culture.Value" />
</form>
}
</div>
</li>