Skip to content

Commit c002db2

Browse files
author
Simon he
committed
chore: add fullScreen
1 parent 4973a5d commit c002db2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/fullScreen.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
export function fullScreen() {
2+
const el: any = document.documentElement;
3+
const rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;
4+
if (rfs)
5+
rfs.call(el);
6+
else
7+
alert("浏览器不支持全屏");
8+
}

0 commit comments

Comments
 (0)