jQuery.remove() - 有没有办法在删除它后取回对象? [英] jQuery.remove() - Is there a way to get the object back after you remove it?
问题描述
我在这个问题上基本上遇到同样的问题:
I basically have the same problem in this questions:
我'我使用.remove jquery调用,这是有效的。但是,当用户滚动隐藏/非隐藏div时,我有上一个/下一个按钮。我需要知道的是,一旦我删除了flash对象,除了刷新页面之外,有没有办法让它恢复?
I've used the .remove jquery call and this works. However, I have previous/next buttons when a user scrolls through hidden/non-hidden divs. What I need to know is, once I remove the flash object, is there a way to get it back other than refreshing the page?
基本上,这可以在客户端处理,还是我需要实现一些服务器端处理。
Basically, can this be handled client side or am I going to need to implement some server side handling.
detach()将无效,因为Flash视频继续播放。
detach() won't work because the flash video continues to play.
我不能隐藏它,因为视频也继续播放。
I can't just hide it because the video continues to play as well.
推荐答案
$myVariable = $("#removeMe").detach();
.detach()
函数是明确的使得从DOM中取出某些东西以便稍后放回去。这是一个很好的。
The .detach()
function is explicitly made to take something out of the DOM to be put back in later. It's a good'n.
API参考: http: //api.jquery.com/detach/
这篇关于jQuery.remove() - 有没有办法在删除它后取回对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!