Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving a node without using appendChild, replaceChild, or insertBefore

Status
Not open for further replies.
Dec 8, 2003
17,047
0
0
GB
Can anyone think of a way to move nodes around the DOM without using appendChild, replaceChild, or insertBefore?

All I need to do is to be able to move IFRAMEs around, but unfortunately, doing so using the above methods causes the IFRAME contents to be re-loaded, or in the case of dynamic content, the content is lost altogether in Firefox.

This has been an outstanding bug since August 2004:


And apparently also happens in Opera 9.5 and Safari 3.1 as well :-(

See also:



Unfortunately, the nextSibling and previousSibling properties are read-only, so I cannot manipulate those. I think I may be out of luck, but if there's any way to re-order nodes without this side effect, I'll be a very happy man :)

Incidentally, wrapping the IFRAMEs in DIVs and moving the DIVs has the same side-effect, so that's a no-go.

Thanks,

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Hi

I am afraid there is not other way.

But you can change the approach : move the other elements around the [tt]iframe[/tt].

That seems to work in some basic tests. But not sure how complex is your document and from where to where you try to move the [tt]iframe[/tt].

Feherke.
 
Unfortunately, the sibling elements are all iframes with dynamic content, so moving the other elements is also out :-(



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Basically, the structure is:

Code:
<div>
   <iframe 1>
   <iframe 2>
   ...
   <iframe n>
</div>

and I need to re-order the iframes.



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Moving them visually is not an option... I already set zIndexes, but I'm trying to work around thread215-1538575 which seems to require actually having a different source order :(



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Tech Snippets & Info:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top