jquery - How to know default position of the element? -


suppose of following html:

<main class="main">    <div class="foo"></div> </main> 

.foo may anywhere in document not in above html. may this:

<header class="header">    <div class="bar"></div>    <div class="blah">       <div></div>       <div></div>       <div class="foo"></div>       <div></div>    </div> </header> 

so, shift .foo element footer:

$('.foo').appendto('.footer') 

now, after time want rollback .foo element default position , place .foo there:

$('.foo').appendto(????) //or, $('.foo').insertafter(????) //or, $('.foo').insertbefore(????) 

how should play this?

if don't want hide original object , clone or want keep 1 instance of element, can add dummy hidden element after , then, hidden element , append div after


Comments

Popular posts from this blog

java - Oracle EBS .ClassNotFoundException: oracle.apps.fnd.formsClient.FormsLauncher.class ERROR -

c# - how to use buttonedit in devexpress gridcontrol -

nvd3.js - angularjs-nvd3-directives setting color in legend as well as in chart elements -