简体   繁体   中英

ie6 hover and jquery error

Can anyone see why this would not work in IE6. The hover image is not displaying at all nor is if I substitute for background-color. I have tried absolute and relative paths. I would be grateful if someone could point out my error. Thank you.

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 />

Try this:

  1. Change ".buttonMailTrue:hover" to ".hover"
  2. Add a "<" to the start of your SPAN tag.
  3. Remove "background-repeat: no-repeat;" from your CSS as you're declaring it twice.
  4. Add in some background position values to your CSS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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