使用chrome,我的网站运行正常。使用IE,鼠标悬停不起作用

时间:2013-10-09 17:43:22

标签: html css internet-explorer google-chrome

所以这是我的代码:

<th width="14%" height="63" scope="col">
    <img 
        src="GFX/home-navi.fw.png" 
        width="140" height="63" 
        onmouseover="this.src='GFX/home-navi-mo.fw.png';" />
</th>

鼠标悬停在Chrome上完美运行,但不适用于IE。我该怎么办?

2 个答案:

答案 0 :(得分:0)

仅供参考:

Docs for IE Mouseover

无论如何,你会试试mouseenter

The mouseenter JavaScript event is proprietary to Internet Explorer. 
Because of the event's general utility,     
jQuery simulates this event so that it can be used regardless of browser. 
This event is sent to an element when the mouse pointer enters the element.
Any HTML element can receive this event.

但是我的IE8就像这样工作

<body>
<table>
    <th width="14%" height="63" scope="col">
    <img src="https://www.google.de/images/srpr/logo6w.png" width="100" height="50"     onmouseover="this.src='http://gameplayer-magazine.de/WordPress/wp-content/gallery/google/google-2.jpg';">
    </th>
    </table>
</body>

Fiddle

也许您的资源不在线?

我认为如果你告诉我们你可以使用哪个IE版本会非常有帮助吗?

麻烦

答案 1 :(得分:0)

尝试使用CSS来显示悬停效果:

<th width="14%" height="63" scope="col">
      <img class="img" width="140" height="63"/>
</th>

<style>
    .img
    {
        background:url(GFX/home-navi.fw.png);
    }  
    .img:hover
    {
        background:url(GFX/home-navi-mo.fw.png);
    }  
</style>