English 中文(简体)
多个CSS & jQuery的下台男子在被点击后仍然开放。
原标题:Multiple CSS & jQuery-based dropdown menus remain open after clicking on another one

I m 根据以下的理论,在一页上设置了多页的 j菜单:

我在几个地方修改了该守则,我提出以下解决办法:。 http://jsfiddle.net/NcNHf/2/

它很出色地工作,但我 m想一种途径来,把另一个倒塌的男子————在我点击另一个人时仍然开放。

因此,我只能确保<>one。 下降的菜单可以随时在网页上启用?

提前感谢!

最佳回答

You can select all dropdowns and filter out current, then hide them all.

$(".dropdown > dt a").click(function (e) {
    var $ul = $(this).parent().next().find( > ul ).toggle();
    $( .dropdown ul ).not($ul).hide();
    e.preventDefault();
});

rel=“nofollow”>Working example

问题回答

暂无回答




相关问题
PHP Combo Box AJAX Refresh

I have a PHP page that currently has 4 years of team positions in columns on the page. The client wants to select the players in positions and have first, second and thrid choices. Currently the page ...

jquery + ajax + json + fill dropdown list not working

I m pretty sure i am almost there....but i cannot figure out how to iterate through json objects and fill a dropdown list. Here is the js code: My JSON data returned:{"name":"County1","name":"County1"...

Gridviews and DropdownLists

Is it possible to change the data source of a dropdown list in a gridview from another dropdown list selected index changed method in the same gridview? for example I have a dropdown that needs to ...

Adding a new value to the drop down list box

I have a drop down list box which has one of the values to be others. I want to move these value to the last. Please help me with this. The code i am using is as follows ddlAssetsCountryOthersone....

Show hide div using codebehind

I have a DropDownList for which I am trying to show a div OnSelectedIndexChanged but it says OBJECT REQUIRED. I am binding the DataList in that div: aspx: <asp:DropDownList runat="server" ID="...

Why might dropdownlist.SelectedIndex = value fail?

I have a dropdown list that I am binding to a datatable. Here is the code I am using to do it: ddlBuildAddr.DataSource = buildings ddlBuildAddr.DataTextField = "buildingName" ddlBuildAddr....

热门标签