IE7/8: div loses :hover if mouse moves over an iframe which is inside the div!(IE7/8:如果鼠标移到 div 内的 iframe 上,则 div 会丢失 :hover!)
问题描述
我正在尝试在列表中添加 facebooklike 按钮"和 twittertweet 按钮",我的列表结构是:
I'm trying to add facebook "like button" and twitter "tweet button" on a list, my list structure is:
<list>
<listItem>
<iframeContainer>
<iframe/>
</iframeContainer>
</listitem>
</list>
css 是:
listItem iframeContainer {display:none;}
listItem:hover iframeContainer {display:block;}
IE7/8:问题是当鼠标移到 iframe 上时,listItem 失去焦点.
IE7/8: the problem is when mouse moves over the iframe the listItem loses its focus.
我尝试通过 csshover.htc 修复它,但它没有修复它.
I tried to fix it by csshover.htc but it doesn't fix it.
它在其他浏览器中运行良好.
It works fine in other browsers.
你可以在这里现场查看:
http://bit.ly/hsFtq6
您需要在网站上注册,它既简单又快捷:)
you can check it out live here:
http://bit.ly/hsFtq6
you need to signup at website, it's easy and fast :)
谢谢
推荐答案
我已经用和csshover.htc一样的方法修复了,虽然添加csshover.htc没有修复!
I've fixed it by the same way as csshover.htc though adding csshover.htc didn't fix it!
if($.browser.msie){
$('.item').live('mouseenter',function() {
$(this).addClass('hover');
});
$('.item iframe').live('hover',function() {
$(this).parents(".item").addClass('hover');
});
$(".item").live('mouseleave',function() {
$(this).removeClass('hover');
});
}
css:
.item:hover, .item.hover {background-color:#555;}
这篇关于IE7/8:如果鼠标移到 div 内的 iframe 上,则 div 会丢失 :hover!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:IE7/8:如果鼠标移到 div 内的 iframe 上,则 div 会丢失 :hover!


基础教程推荐
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01