jQuery的效果基本show()。remove()方法似乎并没有显示效果基本show动画删除之前发生 [英] jQuery slideUp().remove() doesn't seem to show the slideUp animation before remove occurs

查看:275
本文介绍了jQuery的效果基本show()。remove()方法似乎并没有显示效果基本show动画删除之前发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样一行JavaScript和我看到的行为是 selectedLi 瞬间消失,没有滑起来。这不是我所期望的行为。

我应该怎么做,使 selectedLi 被删除之前滑出了?

  selectedLi.slideUp(正常),删除()。


解决方案

也许能够通过将呼叫回调个参数效果基本show删除解决?

例如

  selectedLi.slideUp(正常,函数(){$(本)一个.remove();});

I have this line of JavaScript and the behavior I am seeing is that the selectedLi instantly disappears without "sliding up". This is not the behavior that I expected.

What should I be doing so that the selectedLi slides up before it is removed?

selectedLi.slideUp("normal").remove();

解决方案

Might be able to fix it by putting the call to remove in a callback arg to slideUp?

e.g

selectedLi.slideUp("normal", function() { $(this).remove(); } );

这篇关于jQuery的效果基本show()。remove()方法似乎并没有显示效果基本show动画删除之前发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆