0

谁能明白为什么这在 IE6 中不起作用。悬停图像根本不显示,如果我代替背景颜色也不会显示。我试过绝对和相对路径。如果有人能指出我的错误,我将不胜感激。谢谢你。

CSS

.buttonMailTrue:hover {
    width:290px;
    height: 44px;
    background: url('http://localhost/sample/users/images/mail_icon_strip_hover.png') no-repeat;
    background-repeat: no-repeat;
}

JS

<script type="text/javascript">
    $(function() {
        $('.buttonMailTrue').hover(function() {
            $(this).addClass('hover');
        }, function() {
            $(this).removeClass('hover');
        });
    });
</script>

HTML

<div class='msgTrue buttonMailTrue' data-message='%s' data-subject='%s' data-rowdate='%s' data-from='%s'>
    <img src="images/sml_new_mail_icon.gif" class="mailIcon" alt="" />
    $subject;
    <div style="float:right;margin-right:22px;margin-top:-12px;font-size:9px;">
        $rowdate
    </div><br />
    span style="font-weight:bold;margin-top:50px;">$from</span>
</div>
<br />
4

1 回答 1

2

试试这个:

  1. 将“.buttonMailTrue:hover”更改为“.hover”
  2. 在 SPAN 标签的开头添加一个“<”。
  3. 删除“背景重复:无重复;” 来自您的 CSS,因为您要声明它两次。
  4. 在 CSS 中添加一些背景位置值。
于 2012-11-19T10:45:50.773 回答