Fullscreen API fullscreenEnabled() method
- Προηγούμενη Σελίδα fullscreenElement
- Επόμενη Σελίδα requestFullscreen()
- Επιστροφή στο Προηγούμενο επίπεδο API Fullscreen του JavaScript
Definition and usage
fullscreenEnabled()
Returns a boolean value indicating whether the document can be viewed in fullscreen mode.
If fullscreen mode is available, the method fullscreenEnabled()
The method returns true if the fullscreen mode is available, otherwise it returns false.
Tip:Please use elementMethod .requestFullscreen() View element in fullscreen mode.
Tip:Please use elementMethod .exitFullscreen() Exit fullscreen mode.
Example
Example 1
Display <video> elements in fullscreen mode:
/* Get the element you want to display in fullscreen */ var elem = document.getElementById("myvideo"); /* Function to open fullscreen mode */ function openFullscreen() { /* If fullscreen mode is available, display element in fullscreen */ if (document.fullscreenEnabled) { /* Display element in fullscreen */ elem.requestFullscreen(); } }
Example 2
Use prefixes for cross-browser code:
/* If fullscreen mode is available, do something */ if ( document.fullscreenEnabled || /* Standard syntax */ document.webkitFullscreenEnabled || /* Safari */ document.msFullscreenEnabled/* IE11 */ ) { ... }
Γλώσσα προγραμματισμού
document.fullscreenEnabled()
Παράμετροι
Δεν υπάρχει.
Τεχνικά λεπτομέρειες
Αποτελέσματα: |
Μαθηματικός τιμή, που δείχνει αν είναι δυνατή η προβολή σε πλήρη οθόνη:
|
---|
Υποστήριξη περιηγητών
Τα αριθμήματα στην τаблицή σηματοδοτούν την πρώτη έκδοση του περιηγητή που υποστηρίζει πλήρως αυτή τη μέθοδο.
Σημειώσεις:Επιλογή συγκεκριμένων προефiks (βλέπε τα παρενθέσεις):
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
71.0 45.0 (webkit) |
12.0 11.0 (ms) |
64.0 47.0 (moz) |
6.0 (webkit) | 58.0 15.0 (webkit) |
- Προηγούμενη Σελίδα fullscreenElement
- Επόμενη Σελίδα requestFullscreen()
- Επιστροφή στο Προηγούμενο επίπεδο API Fullscreen του JavaScript