我有以下使用jquery控制的自定义样式下拉列表。出于某种原因,下拉始终默认为打开,并且在选择项目时不会关闭,仅在IE8中。
已移除网址
<section class="main">
<div class="wrapper-demo">
<div id="dd" class="wrapper-dropdown-1" tabindex="1">
<span>Gender</span>
<ul class="dropdown" tabindex="1">
<li><a href="#">Male</a></li>
<li><a href="#">Female</a></li>
</ul>
</div>
</div>
</section>
答案 0 :(得分:3)
我认为问题可能是你没有为ie设置不透明度.wrapper-dropdown-1 .dropdown。请尝试下面myabe帮助隐藏下拉菜单中的代码,即
.wrapper-dropdown-1 .dropdown {
/* Size & position */
position: absolute;
top: 30px;
left: 0;
right: 0;
z-index: 900;
/* Styles */
background: #d3d3d3;
list-style: none;
font-weight: normal; /* Cancels previous font-weight: bold; */
/* Hiding */
opacity: 0;
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
/* IE 5-7 */
filter: alpha(opacity=0);
pointer-events: none;
}
.wrapper-dropdown-1.active .dropdown {
opacity: 1;
/* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
/* IE 5-7 */
filter: alpha(opacity=100);
pointer-events: auto;
}