0

I'm currently using this to relocate an element if the user accesses the page via portrait mode:

<script>if(window.innerHeight > window.innerWidth){ document.write('<div id="bigdiv2" style="position:relative; top: 70px; left: -410px;">');}
</script>
Element
<div>

However, due to the destructive nature of document.write aswell as other scripts taking precedence, this completely overwrites the page onload.

Is there a better alt. (append ?) to make this work ?

VLAZ
  • 26,331
  • 9
  • 49
  • 67

0 Answers0