Full screen display, support PC/mobile, less than 1kb. πOnline demo
δΈζ | English
npm i -S be-fullimport{beFull}from'be-full';beFull();constel=document.getElementById('video');beFull(el);If there is a "black" gap (or other colors) when the element is full screen, the second parameter can be set to the specified color.
constel=document.getElementById("video");beFull(el,"#fff");Note: After executing "exitFull" or "toggleFull", the setting of ":fullscreen" will be automatically canceled.
exitFull();The method of use is the same as beFull, except that the second click will execute exitFull
toggleFull();// Switch the specified element to full screen/exittoggleFull(document.getElementById('video'));isFull(document.getElementById('video'));// true or false