语义UI下拉菜单不显示下拉菜单,但是其他所有功能都正常工作 [英] Semantic UI Dropdown is not showing the drop down but everything else is working

查看:381
本文介绍了语义UI下拉菜单不显示下拉菜单,但是其他所有功能都正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ASP.NET Web窗体应用程序中使用 Semantic UI Dropdown 。它在这个小提琴上工作正常。但在我的应用程序中,它没有显示在选择器div上单击时的下拉菜单。另外,我可以通过搜索选择元素,但在这种情况下,下拉菜单也不显示。当我使用Firefox进行检查时,发现 display:none 属性对于 .menu 类没有变化。当我研究SO时,发现了以下相关问题:语义UI下拉式不起作用语义UI下拉不起作用。我尝试了解决方案,但他们都没有工作。我在我的项目中检查了其他的CSS,他们都没有显示任何冲突。那么,它有什么问题?您可以在小提琴中找到我的下拉代码。

解决方案

有时您必须初始化语义的JS部分。
尝试在窗口的 .onLoad()中调用 .dropdown() p>

<`>`js

  window.onload = function(){
$('。ui.dropdown')。dropdown();
};

```


I am using Semantic UI Dropdown in my ASP.NET Web Forms application. Its working fine in this fiddle. But in my application it is not showing the drop down when clicked on the selector div. Also, I can select the elements by searching but in that case too the drop down is not showing. When I inspected using Firefox, I found that display: none property is not changing for .menu class. When I researched on SO, I found these related questions: Semantic-ui dropdown is not working and semantic UI dropdown not working. I tried the solutions but none of them seem to work. I checked other css in my project none of them shows any conflict. Then, what is wrong with it? You can find my dropdown code in the fiddle.

解决方案

Sometimes you'll have to initialize the JS part of semantic. Try calling the .dropdown() function in the .onLoad() of the window.

```js

window.onload = function(){
    $('.ui.dropdown').dropdown();
};

```

这篇关于语义UI下拉菜单不显示下拉菜单,但是其他所有功能都正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆