当前位置: 首页 > 工具软件 > fullscreen.js > 使用案例 >

ke-fullscreen.js

单琛
2023-12-01

ke-fullscreen.js

This is a Javascript plug-in that can be used across browsers Fullscreen API.


repository

github

码云

Install

$ npm install --save ke-fullscreen

Support

Desktop

FeatureChromeEdgeFirefoxIEOperaSafari
Basic support15Yes9.01112.105.0
fullscreenEnabled20Yes10.01112.105.1

You can also visit Fullscreen API to learn more.

Simple to use

html

 <!-- import js -->
 <script src="ke-fullscreen.min.js"></script>
 <script>
     /* use
      * fullscreen as a global object.
      */
     console.log(fullscreen.isEnabled());
 </script>

css

/*
    The width and height of the dom which is passed into fullscreen.launch() as a parameter will be set to 100% in fullscreen mode.
    for example:
                fullscreen.launch(document.querySelector('#container')).
*/
#container:-webkit-full-screen {
    width: 100%;
    height: 100%;
}

#container:-moz-full-screen {
    width: 100%;
    height: 100%;
}

#container:-ms-fullscreen {
    width: 100%;
    height: 100%;
}

#container:fullscreen {
    width: 100%;
    height: 100%;
}

Package

$ gulp package

or

$ npm start

Build (development)

$ gulp package-dev

Documentation

$ gulp doc

Reference

License

MIT © porky-prince

 类似资料:

相关阅读

相关文章

相关问答