嗨 我有一个约150px宽,300px深的图像。当我翻转它时,我想要一个小图像在上面弹出。当我滚出更大的图像时,我希望较小的图像消失。简单的动画jQuery不稳定的触发
这一切都有效,但是如果将鼠标悬停在新图像弹出的触发图像上,那么它看起来会进入某种循环或在您移动鼠标时行为不正常。我试过悬停和鼠标悬停/悬空。我期望它在鼠标移动时触发滚降/滚动事件。
你可以看到这个提前www.ypfservice.net
感谢
Ë
,这里是我的jQuery:
$(document).ready(function() {
var numberLinks = $('a.panelImage').length;
for (var j = 0; j < numberLinks; j++) {
var currentLink = $('a.panelImage').eq(j);
// var currentLink = $('a.panelImage:eq('+j+')');
$('<div class="fred"></div>').insertAfter(currentLink);
var gtr = currentLink.position().left + 'px';
$(currentLink).next().css({ // ie div.fred
'position': 'absolute',
'background-position': '0 0',
'top': '100px',
'left': gtr,
'display': 'none',
'width': '5px',
'height': '5px',
'overflow': 'hidden',
'backgroundImage': 'url(http://www.ypfservice.net/templates/ypftemplate/images/foyerPreview.jpg)',
});
}
$('a.panelImage img').mouseover(function() {
$(this).parent().next().stop().animate({
height: '138px',
width: '184px'
}, 500)
}).mouseout(function() {
$(this).parent().next().stop().animate({
'width': '0px',
'height': '0px'
}, 500);
}); //end function
});
感谢您的回复 - 这非常有意义并且运作良好。 – maxelcat 2010-10-16 19:05:45
好吧,它在FF和IE中工作得很好。但在Opera,Chrome或Safari(pc)中完全没有任何反应。任何想法为什么?谢谢 – maxelcat 2010-10-16 20:23:03