LoginSignup
23
22

More than 5 years have passed since last update.

JSでブラウザを全画面表示(フルスクリーン)に切り替える

Posted at
// フルスクリーンに切替
$('.fullscreen').on('touchstart', function(){
    if(document.body.webkitRequestFullScreen) {
        document.body.onwebkitfullscreenchange = function(e) {
            document.body.style.width = window.innerWidth + 'px';
            document.body.style.height = window.innerHeight + 'px';
            document.body.onwebkitfullscreenchange = function() {};
        }
        document.body.webkitRequestFullScreen();
    }
});
23
22
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
23
22