Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/74.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使下拉菜单打开移动下面的下拉菜单_Javascript_Html - Fatal编程技术网

Javascript 如何使下拉菜单打开移动下面的下拉菜单

Javascript 如何使下拉菜单打开移动下面的下拉菜单,javascript,html,Javascript,Html,我有两个按钮,当你点击一个下拉菜单时会打开。但是当我点击上面的按钮时,我希望下面的按钮也随之移动。如果有人知道我想做什么,请帮助:) 在代码段中,当另一个按钮打开时,无法单击其中一个按钮,我不知道这是为什么。当我在谷歌上运行它时,它工作正常 $('.dropdown toggle')。打开('click',函数(e){ $(this.next().toggle(); }); $('.下拉菜单.保持打开')。打开('单击',函数(e){ e、 停止传播(); }); 如果(1){ $('body

我有两个按钮,当你点击一个下拉菜单时会打开。但是当我点击上面的按钮时,我希望下面的按钮也随之移动。如果有人知道我想做什么,请帮助:)

在代码段中,当另一个按钮打开时,无法单击其中一个按钮,我不知道这是为什么。当我在谷歌上运行它时,它工作正常

$('.dropdown toggle')。打开('click',函数(e){
$(this.next().toggle();
});
$('.下拉菜单.保持打开')。打开('单击',函数(e){
e、 停止传播();
});
如果(1){
$('body').attr('tabindex','0');
}
否则{
alertify.confirm().set({'reverseebuttons':true});
alertify.prompt().set({'reverseButtons':true});
}

标题
下拉按钮
  • 单击此处不会关闭弹出窗口 空标签 下拉按钮
  • 单击此处不会关闭弹出窗口 空标签
  • 我重新构建了下拉列表,使其内容处于静态位置,而不是默认的绝对位置

    $('.dropdown toggle')。打开('click',函数(e){
    if($(this.attr('aria-expanded')=='false'){
    $(this.attr('aria-expanded','true'))
    $($(this).data('toggle')).css('height','auto'))
    }else if($(this.attr('aria-expanded')='true')){
    $(this.attr('aria-expanded','false'))
    $($(this).data('toggle')).css('height',0)
    }
    });
    
    .drpodown内容{
    身高:0;
    溢出:隐藏;
    }
    .扩大{
    高度:自动;
    }
    
    标题
    下拉按钮
    单击此处不会关闭弹出窗口
    空标签
    下拉按钮
    单击此处不会关闭弹出窗口
    空标签
    
    我重新构建了下拉列表,使其内容处于静态位置,而不是默认的绝对位置

    $('.dropdown toggle')。打开('click',函数(e){
    if($(this.attr('aria-expanded')=='false'){
    $(this.attr('aria-expanded','true'))
    $($(this).data('toggle')).css('height','auto'))
    }else if($(this.attr('aria-expanded')='true')){
    $(this.attr('aria-expanded','false'))
    $($(this).data('toggle')).css('height',0)
    }
    });
    
    .drpodown内容{
    身高:0;
    溢出:隐藏;
    }
    .扩大{
    高度:自动;
    }
    
    标题
    下拉按钮
    单击此处不会关闭弹出窗口
    空标签
    下拉按钮
    单击此处不会关闭弹出窗口
    空标签