问题描述
我想在列表中添加facebooklike button和twittertweet button,我的列表结构是:
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 is:
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.
您可以在这里查看:
您需要在网站上注册,方便快捷:)
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丢失:hover如果鼠标移动到一个iframe里面的div!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!