Browse Source

fix positioning of VR buttons/labels in WebVR so not obscured by "View Source" when iframed from Examples (fixes #8331)

Christopher Van 9 years ago
parent
commit
7ecee5d25c
1 changed files with 9 additions and 5 deletions
  1. 9 5
      examples/webvr_cubes.html

+ 9 - 5
examples/webvr_cubes.html

@@ -15,7 +15,7 @@
 			.menu {
 				position: fixed;
 				bottom: 20px;
-				right: 20px;
+				left: 20px;
 			}
 
 			.button {
@@ -26,7 +26,7 @@
 			}
 
 			.button.enabled {
-				background-color: rgb(18, 36, 70);
+				background-color: rgb(18, 140, 36);
 			}
 
 			.button:hover {
@@ -130,7 +130,11 @@
 				if ( navigator.getVRDisplays === undefined && navigator.getVRDevices === undefined ) {
 
 					fullScreenButton.innerHTML = 'Your browser doesn\'t support WebVR';
-					fullScreenButton.classList.add('error');
+					fullScreenButton.classList.add( 'error' );
+
+				} else {
+
+					fullScreenButton.classList.add( 'enabled' );
 
 				}
 
@@ -138,7 +142,7 @@
 				vrEffect = new THREE.VREffect( renderer, function ( error ) {
 
 					fullScreenButton.innerHTML = error;
-					fullScreenButton.classList.add('error');
+					fullScreenButton.classList.add( 'error' );
 
 				} );
 
@@ -155,7 +159,7 @@
 
 				stats = new Stats();
 				stats.domElement.style.position = 'absolute';
-				stats.domElement.style.top = '0px';
+				stats.domElement.style.top = '0';
 				container.appendChild( stats.domElement );
 
 				//