【问题标题】:How to always show dropdown below the trigger如何始终在触发器下方显示下拉菜单
【发布时间】:2022-01-17 22:53:15
【问题描述】:

使用materializecss,我有这个代码:

<a class='dropdown-trigger-courseForm filterButton' href='#' data-target='dropdown1'>Drop Me!<i class="fa fa-angle-down filter"></i></a>
<ul id='dropdown1' class='dropdown-content'>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
<li><label><input type="checkbox" /><span>Test</span></label></li>
</ul>

还有这个 jquery:

 $('.dropdown-trigger-courseForm').dropdown({
    coverTrigger: false,
    closeOnClick: false
  });

我想要的是在触发器下方显示下拉列表始终,而不仅仅是在视口上有足够空间时。

【问题讨论】:

    标签: css materialize


    【解决方案1】:

    我正在使用的 materializecss 版本似乎存在高度计算错误或“不良行为”。我只是直接在materializecss javascript文件中更改了javascipt中的高度,它现在可以按我想要的方式工作。

    【讨论】:

      猜你喜欢
      • 2021-10-19
      • 2021-10-23
      • 2018-08-16
      • 2018-11-14
      • 1970-01-01
      • 2019-07-02
      • 1970-01-01
      • 2012-05-27
      • 1970-01-01
      相关资源
      最近更新 更多