如何使用JQUERY链接语义UI下拉列表?

时间:2017-01-03 06:22:07

标签: jquery html semantic-ui

我的代码是

<div class="ui teal inverted menu">
<a class="active item">
<i class="home icon"></i>Home
</a>

<div class="ui dropdown item">
Stock<i class="dropdown icon"></i>
<div class="menu">
<div class="item">Real Time Monitoring</div>
<div class="item" >Market Summary</div>
</div>
</div>

如何映射到jquery?有人可以回答吗?

2 个答案:

答案 0 :(得分:0)

您需要像下面这样初始化您的下拉列表:

$('.ui.dropdown')
  .dropdown()
;

请在此HERE

中找到更多信息

答案 1 :(得分:0)

您可以尝试将此作为样本jsfiddle.net/bharatsing/8z6s2m7a/

<div class="ui teal inverted menu">
<a class="active item">
<i class="home icon"></i>Home
</a>

<div class="ui dropdown item" id="divDDL">
Stock<i class="dropdown icon"></i>
<div class="menu">
<div class="item">Real Time Monitoring</div>
<div class="item" >Market Summary</div>
</div>
</div>

$("#divDDL").dropdown();