这有效,但我不知道为什么.在function capIn()我看来,线$botcap.slideDown("slow")应该滑下div.它将它滑起来.如果我尝试使用.slideUp()没有任何事情发生,好像它试图滑下来.任何人都可以向我解释这个吗?
$(".slide").hover(capIn, capOut);
function capIn(){
//slide top caption down
var $topcap = $(this).children(".topcap");
$topcap.slideDown("slow");
//slide bottom caption up
//!! Why does slideDown slide caption up here?
var $botcap = $(this).children(".botcap");
$botcap.slideDown("slow")
}
function capOut(){
//slide top back up
var $topcap = $(this).children(".topcap");
$topcap.slideUp("slow");
//slide bottom back down
var $botcap = $(this).children(".botcap");
$botcap.slideUp("slow");
}
Run Code Online (Sandbox Code Playgroud)