我有一个下拉数据过滤器,将其与同位素插件一起使用。
我正在尝试关闭一个在单击另一个列表项时打开的下拉列表,并在打开下拉列表时让箭头向下旋转。
我想知道如何实现这一目标。
这是我的 jsfiddle
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
$('#nfbt #nfbtv').click(function(){
$(this).toggleClass('fbt nfv');
});
我使用了教程中的 jquery,因此它位于 html 本身中,如果我将其移动到自己的 .js 文件中,它就不起作用。
最佳答案
Hi Please have a look to this link. I make it to work for your requirement.
If you want to change the arrow then add a class which will have down arrow
css when you toggling it to down.
关于javascript - 单击下拉菜单时隐藏其他下拉菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20581221/