This works, but I'm not sure why. In function capIn(), in my opinion, the line $botcap.slideDown("slow")should shift the div down. He glides. If I try to use .slideUp(), nothing happens, as if he was trying to move it. Can someone explain this to me?
function capIn()
$botcap.slideDown("slow")
.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"); }
JQuery functions slideDownand slideUpare actually wrong. As stated in the documentation for slideUp:
slideDown
slideUp
Hide matched elements with a sliding motion.
; , , , , . , (, position: absolute bottom: 0), , .
position: absolute
bottom: 0
$('.botcap') .
$('.botcap')
, , , . : 0; , , slideDown() . , : ( ), : 0.