【发布时间】:2012-03-30 05:45:28
【问题描述】:
我的上半场表现出色。当我尝试在完成功能中添加一个 .mouseleave 时,它只是冻结了整个事情。谁能看到我哪里搞砸了?
$(document).ready(function() {
$('#TwitterBox').mouseenter(function(event) {
$(this).animate({
top: 0
}, {
duration: 'slow',
easing: 'easeOutBack',
complete: function() {
$('#TwitterBox').mouseleave(function(event) {
$(this).animate({
top: 550
}, {
duration: 'slow',
easing: 'easeOutBack'
});
});
}
});
});
});
这里是 CSS
#TwitterWrap{
background-color: #999;
height: 500px;
width: 300px;
overflow: hidden;
position: absolute;
right: 25px;
bottom: 25px;
}
#TwitterBox{
background-color: #0FC;
height: 400px;
width: 300px;
position: relative;
top: 450px;
}
基本上只是试图在 .mouseenter 上滑动 div 并在 .mouseleave 上向后滑动
【问题讨论】:
-
你为什么要这样嵌套事件?好像不太对...
-
就是这样,我不这么认为。我对牙套感到困惑。我现在得到的结果是 JSlint 告诉我的结果是有效的。
-
我想通了。明天当他们允许我回答我自己的问题时发布
标签: jquery css jquery-animate