它超出了标记,然后在Chrome中再次返回,而不是Firefox。
在此处滚动图片http://dev.nkt-kmc-manjushri.org/
这就是我使用的代码。
// Set height on excerpt for smooth animation
jQuery(".excerpt").each (function() {
jQuery(this).css("height", jQuery(this).height());
});
// Hide excerpts by default
jQuery('.excerpt').hide();
// Fade in
jQuery(".slide").hoverIntent({
over: slidein,
timeout: 100,
out: slideout
});
function slidein(){
// jQuery(this).addClass('active').find('.excerpt').animate({"height":500},400);
jQuery('.slide').not(this).animate({opacity:0.3},400);
jQuery(this).addClass('active').find('.excerpt').slideDown(500);
}
function slideout(){
// jQuery(this).find('.excerpt').animate({"height":0},400);
jQuery('.slide').removeClass('active').animate({opacity:1},400);
jQuery(this).find('.excerpt').slideUp(1500);
} 发布于 2011-01-03 02:08:03
是.height()方法导致了这个问题吗?也许可以尝试使用css (而不是javascript)来设置固定的高度?
height: 18em;我看到的问题是,如果我在每个动画发生之前将鼠标移到几个项目上,它会有奇怪的行为。如果我移动得足够快,我会看到文本被图像所取代。
也许可以考虑这样做:
jQuery('.slide').not(this).stop().animate({opacity:0.3},400);jQuery(this).addClass('active').find('.excerpt').stop().slideDown(500);
还有这个:
jQuery('.slide').stop().removeClass('active').animate({opacity:1},400);jQuery(this).addClass('active').find('.excerpt').stop().slideDown(500);
stop()取消当前动画。
您还可以使用.animate、.slideUp和.slideDown提供的回调。从文档中:
.animate( properties, [ duration ], [ easing ], [ callback ] )和
.slideUp( [ duration ], [ callback ] )然后绑定和解除绑定到一些自定义事件,为您做动画,但这可能是过度杀伤力。
https://stackoverflow.com/questions/4579561
复制相似问题