【发布时间】:2012-06-23 22:09:48
【问题描述】:
嗨,我的代码有什么问题:
当我将鼠标悬停在#open 上时,#pull_down_content 应该从页眉向下移动,当我离开#open 时,它应该向上移动。但是,当我在页面加载后立即测试代码时,#pull_down_content 在我将鼠标悬停在它上面之前就向下移动了屏幕。
$(function() {
//Open on hover
$('#open').hover((function(){
$('#pull_down_content').animate({'top':'-0px'},1000);
})
//Close when not hovered
(function(){
$('#pull_down_content').animate({'top':'-340px'},1000);
})
});
);
【问题讨论】:
-
google.com/search?q=jquery+hover 第一个结果。你为什么不用谷歌?
标签: jquery html css jquery-hover