如何在 3 次延迟后删除元素? [英] How to remove an element after a 3 delay?

查看:16
本文介绍了如何在 3 次延迟后删除元素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$('#gallerie ul li:eq(1)').animate({opacity: 1}, 1250).remove(); //results in instand remove
$('#gallerie ul li:eq(1)').delay(3000).remove(); //instant remove
$('#gallerie ul li:eq(1)').remove().delay(3000); //that didnt work either

如何在 3 秒后移除对象而不是立即移除?

How can I remove the object after 3 seconds instead of being instantly removed?

推荐答案

setTimeout(function(){
     $('#gallerie ul li:eq(1)').remove();
},3000);

这篇关于如何在 3 次延迟后删除元素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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