【发布时间】:2012-04-18 19:28:44
【问题描述】:
我在我的网站上使用了“飞越”效果。喜欢this - 水平效果。
该脚本适用于 IE8、9、FF 和 Chrome。在 IE7 中,我在页面上有多个元素。两者都有相同的id。将鼠标悬停在页面上的第一个项目上,它会加载。将鼠标悬停在另一个上,它根本不起作用。对我来说不是很有意义。
我的代码如下:
HTML
<div style="margin-bottom:30px;" id="takealook-sub">
<a href="#">
<img style="left: -200px;" alt="" src="path/to/image">
</a>
</div>
jQuery
$(function(){
$("#takealook-sub a").hover(function(){
$("img", this).stop().animate({left:"0px"},{queue:false,duration:600});
}, function() {
$("img", this).stop().animate({left:"-200px"},{queue:false,duration:600});
});
});
有谁知道为什么一个可以在 IE7 中工作而另一个不能工作的原因?就像我说的,在所有其他浏览器中一切似乎都很好。
谢谢
【问题讨论】:
标签: jquery internet-explorer-7 cross-browser