mercredi 21 janvier 2015

Change a position of an iframe within the DOM without reloading it?


Vote count:

0




I have a problem concerning DOM manipulation:


I want to change the position of an Iframe in the DOM to be the first child of the body just by moving it up the DOM tree. So far that's easy.


But it reloads the iframe when DOM manipulation is complete. Is there any way to prevent the browser from doing this?


For Demo http://ift.tt/1xVyv7Q



<div class="main-upper">

</div>
<div class="main">
<iframe id="Iframe" src="http://ift.tt/1BDEaXM" frameborder="0"></iframe>
</div>

<script>
el = document.getElementById('Iframe');
document.body.insertBefore(el, document.body.children[0]);
</script>


asked 33 secs ago







Change a position of an iframe within the DOM without reloading it?

Aucun commentaire:

Enregistrer un commentaire