Skip to content

Commit a1b7da9

Browse files
committed
webgl_effects_cardboard: added click to fullscreen.
1 parent e844311 commit a1b7da9

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/webgl_effects_cardboard.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,28 @@
6767
renderer.shadowMap.enabled = true;
6868
document.body.appendChild( renderer.domElement );
6969

70+
renderer.domElement.addEventListener( 'click', function () {
71+
72+
if ( this.requestFullscreen ) {
73+
74+
this.requestFullscreen();
75+
76+
} else if ( this.msRequestFullscreen ) {
77+
78+
this.msRequestFullscreen();
79+
80+
} else if ( this.mozRequestFullScreen ) {
81+
82+
this.mozRequestFullScreen();
83+
84+
} else if ( this.webkitRequestFullscreen ) {
85+
86+
this.webkitRequestFullscreen();
87+
88+
}
89+
90+
} );
91+
7092
//
7193

7294
effect = new THREE.CardboardEffect( renderer );

0 commit comments

Comments
 (0)