Skip to content

Instantly share code, notes, and snippets.

@AVGP
Created October 17, 2016 13:37
Show Gist options
  • Save AVGP/1914371468c1537738566ae288fb59aa to your computer and use it in GitHub Desktop.
Save AVGP/1914371468c1537738566ae288fb59aa to your computer and use it in GitHub Desktop.
Demonstrates the issue with switching between different WebVR content within the same page
<html>
<body>
<button id="first">First Demo</button>
<button id="second">Second Demo</button>
<iframe width="500" height="500" src="03-vr-presentation.html" allowvr></iframe>
<script>
var iframe = document.querySelector('iframe')
document.getElementById('first').addEventListener('click', function() {
iframe.contentWindow.location.href = '03-vr-presentation.html'
})
document.getElementById('second').addEventListener('click', function() {
iframe.contentWindow.location.href = 'XX-360-panorama.html'
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment