How can we programmatically enter and exit the fullscreen mode in javascript?

后端 未结 1 1914
野趣味
野趣味 2020-12-19 03:38

Here\'s documentation on exiting fullscreen mode.

I used this code that I learnd to make the browser go fullscreen (it works), but my attempts to modify a version of

1条回答
  •  旧巷少年郎
    2020-12-19 04:18

    For entering the fullscreen there were some issues with the capitalization.

    For the exiting you need to call it on the document and not on the body, and you also need to apply it correctly instead of calling the reference to the method..

    so requestMethod.call(element); for exiting as well.

    See demo at http://jsfiddle.net/gaby/FGX72/show
    (tested on latest IE/Chrome/FireFox)

    0 讨论(0)
提交回复
热议问题