I am using a forced page reload on orientation change of the website and would like the page refresh to occur 5 seconds after the rotation occurs, but I cannot seem to put the timeout in the correct place.
Here is my code as it stands.
<script type="text/javascript"> // RELOADS WEBPAGE WHEN MOBILE ORIENTATION CHANGES
window.onorientationchange = function() {
var orientation = window.orientation;
switch(orientation) {
case 0:
case 90:
case -90: window.location.reload();
break; }
};
Thank you so much in advance for any help!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…