1
我有一个图像,当我鼠标悬停,我想另一个图像从底部向上“滑动”第一个图像。在鼠标悬停时,图像应该再次消失,从上到下滑动,再次显示第一张图像。鼠标悬停图像并显示另一个,使用jQuery
如何用jQuery做到这一点?我试过animate
和slidetoggle
,但我无法使它工作。
编辑:解
<div class="image" style="width:90px;height:67px;position:relative;overflow:hidden">
<a href="#">
<img style="position:absolute;top:0;left;0;z-index:1;" class="first" src="images/stories/logos/in-dialoog.gif" alt="logo" />
<img style="position:absolute;top:0;left:0;z-index:0;" class="second" src="images/stories/logos/c-riders.gif" alt="logo" />
</a>
</div>
$('.image').mouseenter(function(){
$('.first').stop().animate({
top: '56px'
}, 800, function() {
// Animation complete.
});
});
$('.image').mouseleave(function(){
$('.first').stop().animate({
top: '0'
}, 800, function() {
// Animation complete.
});
});
请问您试过的代码。 – Vivek 2011-05-25 11:07:21