1
私は画像を持っています。マウスオーバーすると、最初の画像を上から下に上にスライドさせる別の画像が必要になります。マウスオーバー時に、画像は再び消え、上から下にスライドして最初の画像を再表示します。mouseover image jQueryを使用して別の画像を表示
jQueryでこれを行う方法は?私はanimate
とslidetoggle
を試しましたが、うまく動作しません。
EDIT:このようなソリューション
<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