Code Monkey home page Code Monkey logo

be-full's Issues

API有没有开启和退出全屏的事件回调

我想在开启全屏退出全屏事件回调里做些事情,可是没有想到相关的API。于是我自己去监测ESC的keyup,ESC的确触发了退出全屏但是我没有捕获到,请问这种情况改如何处理。

全屏方法不能js触发,只能手动触发,这个机制是什么原因呢?

if (device.mobile()) {

    console.log('移动手机')

  } else if (device.ipad()) {

    console.log('ipad')

  } else if (device.desktop()) {
    beFull()
    console.log('电脑')

  }

按照上边这样写,就不起作用。
控制台提示以下警告

Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.

用快捷键全屏有bug

环境:chrome 81.0.4044.129和chromium edge 81.0.416.64
用F11全屏之后再点击手动检测为false

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.