嗨,我的页面上有一个简单的 CSS 悬停菜单,但在使用触摸设备时,它似乎不适用于 IE10。
这个问题有什么解决办法吗?
示例:http: //jsfiddle.net/Z8Q8T/
html:
<ul class="Menu">
<li>
<a href="javascript:void(0);">First</a>
<ul>
<li>
<a href="#1" class="Active">1</a>
</li>
<li>
<a href="#2">2</a>
</li>
<li>
<a href="#3">3</a>
</li>
<li>
<a href="#4">4</a>
</li>
</ul>
</li>
<li>
<a href="javascript:void(0);">Second</a>
<ul>
<li>
<a href="#5">5</a>
</li>
<li>
<a href="#6">6</a>
</li>
<li>
<a href="#7">7</a>
</li>
<li>
<a href="#8">8</a>
</li>
</ul>
</li>
</ul>
CSS:
.Menu, .Menu ul {
list-style: none;
display: block;
margin: 0;
}
.Menu > li {
float: left;
padding-bottom: 1px;
margin: 0 10px;
font-family: Arial, Helvetica, sans-serif;
font-size: 11px;
text-transform: uppercase;
}
.Menu > li:hover, .Menu > li:active {
position: relative;
}
.Menu li a {
display: block;
color: #000000;
text-decoration: none;
}
.Menu > li > a {
border-bottom-style: solid;
border-bottom-width: 3px;
border-bottom-color: transparent;
}
.Menu > li > a:hover, .Menu > li > a:active {
border-bottom-color: #A9A9A9;
}
.Menu li > ul {
margin-top: 0px;
/* to ensure that we dont leave the ul and the hovering effect stops */
border-radius: 0 0 3px 3px;
-o-border-radius: 0 0 3px 3px;
-ms-border-radius: 0 0 3px 3px;
box-shadow: 0px 0px 3px #888;
padding: 0px 2px 2px 2px;
background-color: White;
position: absolute;
left: -4000px;
/* Hack to fix animation */
min-width: 100%;
opacity: 0;
transition: opacity 0.2s linear;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
}
.Menu li:hover > ul, .Menu li a:active + ul {
left: -4px;
z-index: 100;
opacity: 1;
}
.Menu li ul > li {
border-left-style: solid;
border-left-width: 3px;
border-left-color: transparent;
padding: 0 3px;
margin: 3px 0;
white-space: nowrap;
}
.Menu li ul > li:hover, .Menu li ul > li:active {
border-left-color: #A9A9A9;
}
.Menu li ul > li.Active {
border-left-color: black;
}