我在我的网站上使用“飞越”效果。像这样- 水平效应。
该脚本适用于 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 中工作,而另一个不能工作的原因?就像我说的,在所有其他浏览器中一切似乎都很好。
谢谢