မျက်နှာပြင်အပြည့် API fullscreenEnabled()
ဥပမာ
မျက်နှာပြင်အပြည့်မုဒ်တွင် <video> အစိတ်အပိုင်းကို ပြပါ-
/* Get the element you want displayed in fullscreen */
var elem =
document.getElementById("myvideo");
/* Function to open fullscreen mode
*/
function openFullscreen() {
/* If fullscreen mode is
available, show the element in fullscreen */
if (document.fullscreenEnabled)
{
/* Show the element in fullscreen */
elem.requestFullscreen();
}
}
အဓိပ္ပါယ်နှင့် အသုံးပြုမှု
fullscreenEnabled() နည်းလမ်းသည် စာရွက်စာတမ်းအား မျက်နှာပြင်အပြည့်မုဒ်တွင် ကြည့်ရှုနိုင်သည်ရှိမရှိ ညွှန်ပြသည့် Boolean တန်ဖိုးကို ပြန်ပေးသည်။
fullscreenEnabled() နည်းလမ်းသည် ဖန်သားပြင်အပြည့်မုဒ်ကို ရရှိပါက၊ မဟုတ်ပါက false ပြန်ပေးသည်။
အကြံပြုချက်- မျက်နှာပြင်အပြည့်မုဒ် တွင် အစိတ်အပိုင်း တစ်ခုအား ကြည့်ရှုရန် .requestFullscreen() နည်းလမ်းကို အသုံးပြုပါ။
အကြံပြုချက်- မျက်နှာပြင်အပြည့်မုဒ်ကို ပယ်ဖျက်ရန် .exitFullscreen () နည်းလမ်းကို အသုံးပြုပါ ။
Browser ပံ့ပိုးမှု
ဇယားရှိ နံပါတ်များသည် နည်းလမ်းကို အပြည့်အဝထောက်ခံသည့် ပထမဆုံးဘရောက်ဆာဗားရှင်းကို သတ်မှတ်ပေးသည်။ မှတ်ချက်- အချို့ဘရောက်ဆာများသည် သီးခြားရှေ့ဆက်တစ်ခု လိုအပ်သည် (ကွင်းစဥ်များကိုကြည့်ပါ)။
Method | |||||
---|---|---|---|---|---|
fullscreenEnabled() | 71.0 45.0 (webkit) |
12.0 11.0 (ms) |
64.0 47.0 (moz) |
6.0 (webkit) | 58.0 15.0 (webkit) |
ဥပမာ
ဘရောက်ဆာဖြတ်ကျော်ကုဒ်အတွက် ရှေ့ဆက်များကို အသုံးပြုခြင်း-
/* If fullscreen mode is available, then do something */
if (
document.fullscreenEnabled || /* Standard syntax */
document.webkitFullscreenEnabled || /* Safari */
document.msFullscreenEnabled/* IE11 */
) {
...
}
အထားအသို
document.fullscreenEnabled()
ကန့်သတ်ချက်များ
တစ်ခုမှ |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | စာရွက်စာတမ်းအား စခရင်အပြည့်မုဒ်တွင် ကြည့်ရှုနိုင်မညကို ညွှန်ပြသော Boolean တန်ဖိုး
|
---|
❮ မျက်နှာပြင်အပြည့် API