简体   繁体   English

Onmouseover 和 onmouseout 在 IE 中不起作用

[英]Onmouseover & onmouseout not working in IE

I have a problem with onmouseover and onmouseout events.我对 onmouseover 和 onmouseout 事件有疑问。 I am working on it on my site: http://pacogames.com/ When you visit it by Chrome or FF and you move with mouse over the games, you can see the video of the game, but when you visit it by IE, the video is played only when you are with mouse over the white space.我正在我的网站上处理它: http : //pacogames.com/当您通过 Chrome 或 FF 访问它并在游戏上移动鼠标时,您可以看到游戏的视频,但是当您通过 IE 访问它时, 仅当您将鼠标悬停在空白区域时才会播放视频。 When your mouse is on the image, you cannot see the video.当您的鼠标在图像上时,您看不到视频。 (I mean the game in the div.BOXRIGHT). (我指的是 div.BOXRIGHT 中的游戏)。

Here is the code for expamle:这是示例代码:

<li id="videobox-1" class="videobox">
  <a href="url_game" id="OdkazVideo1"> 
    <div id="video1">
    </div>
    <div style="display:block; position: absolute; top: 5px; width: 163px; height: 182px; z-index: 90;" onmouseover="PrehrajVideo(1, 'game_video.swf')" onmouseout="ZastavVideo(1)">
    </div> 
  </a>         
  <a href="url_game">   
   <img class="BOXGAMES_IMG" src="image_game.png" alt="play name_game" style="position: relative; z-index: 1;" /><br />game_name
</a> 
    <span style="width: 100px; height: 22px; float:left; padding: 5px 30px 0 30px;">'.$game['rating'].'</span>
    <p class="BOXGAMES_PLAYS">200 Plays </p>   
</li>';

And JS functions和 JS 函数

function PrehrajVideo (id, video) {   

  var params = {
      'wmode': 'transparent',
      'quality': 'high',
      'mute': '1'
  }
  swfobject.embedSWF(video, "video"+id, "163", "123", "7", false, "", params, "" ); 
}

function ZastavVideo (id) { 
  swfobject.removeSWF("video"+id);
  $('#OdkazVideo'+id).prepend("<div id='video"+id+"'></div>");
}

Can anyone help me with this problem?谁能帮我解决这个问题? Thanks a lot.非常感谢。

Use onMouseLeave event for IE.对 IE 使用 onMouseLeave 事件。 This will solve the problem.这将解决问题。

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

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