【发布时间】:2011-11-26 07:09:04
【问题描述】:
$(document).ready(function(){
function anima() {
$(".box").stop().animate({bottom:'0px'},{queue:false,duration:160});
}
$('ul#aa img').hover(function(){
$(this).parent().append("<div class='box'>Artist<br/>More</div>", anima());
}, function() {
$(".box").stop().animate({bottom:'-100px'},{queue:false,duration:160, complete: function(){
$('.box').remove();} });
});
<ul id="aa"><li id="bb">
<img src="delete.jpg"title="one|date|location|detail"/>
</li>
</ul>
我正在尝试在悬停时添加一个 div 框,然后让它向上滑动(这部分有效),但是在鼠标移出时我想对其进行动画处理并删除 div(不起作用,只是删除,不动画)。
还有:$('#caption', this)?
这叫什么?在此元素内设置标题?
【问题讨论】:
-
$('#caption', this);第二个参数是“上下文”。它正在其中寻找#caption(或您传入的任何内容)。 api.jquery.com/jQuery
标签: jquery