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
Post a Comment