简体   繁体   English

IE7表现奇特,悬停在ul列表上,没有任何中断

[英]IE7 acting odd, hovering over ul li list appears without any break

I have action list that i show when i am hover over an a link. 我有将鼠标悬停在链接上时显示的操作列表。 it works fine in firefox 3.6 and Ie8 but its not working the same in IE7. 它在firefox 3.6和IE8中工作正常,但在IE7中却无法正常工作。

Here is my code: 这是我的代码:

<td class="noTableStyle">
 <a href="#">Actions</a>
  <ul>
   <li><a href="#" title="Edit">Edit</a></li>
   <li><a id="Delete" href="#">Delete</a></li>
  </ul>
</td>

Here is my Jquery code: 这是我的Jquery代码:

$(document).ready(function() {
        //Initialize action menu behaviour
        $("td.noTableStyle ul").hide();
        $("td.noTableStyle a").hover(function() {
            $(this).next().slideDown('fast');
        });
        $("td.noTableStyle").hover(null, function() {  $(this).children("ul").slideUp('fast'); });
   });

here is my CSS: 这是我的CSS:

d.noTableStyle { 
    background-color:Transparent;
}
td.noTableStyle ul { 
    margin-top:0px; 
    list-style-type:none;
    z-index: 2; 
    position:absolute;
    float:left; 
    background-color: #EBF5F8;
    margin-left: 1px;
    padding-left:0px;
}
td.noTableStyle ul {
    background-color:#EBF5F8; 
    padding:2px;
}

In firefox/IE8 the link appears under action but in IE7 the edit and delete links are appearing on the right hand side. 在firefox / IE8中,该链接显示在操作中,但在IE7中,编辑和删除链接显示在右侧。

I would really love some help. 我真的很乐意提供帮助。 thanks all 谢谢大家

The combination of position: absolute; 组合position: absolute; and float: left; float: left; make it to stick on the right hand side of the link. 使其贴在链接的右侧。 Since you want to have it right below the link and the <ul> is by default already a block element, I don't see any value of making it position: absolute; float: left; 由于您希望将其放置在链接的正下方 ,并且<ul>默认情况下已经是一个块元素,因此我看不到将其position: absolute; float: left;任何信息position: absolute; float: left; position: absolute; float: left; . So I'd suggest to just remove those properties. 所以我建议只删除那些属性。 It will work in all browsers the way you expect. 它会以您期望的方式在所有浏览器中运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM