forked from skjApp/HTML5-Examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFullScreen.htm
More file actions
39 lines (28 loc) · 855 Bytes
/
FullScreen.htm
File metadata and controls
39 lines (28 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE HTML>
<html>
<head>
<title>Example - FullScreen API</title>
</head>
<body>
<canvas id = 'canvas1' width = '300px' height = '300px'> Canvas Tag </canvas>
<script type = 'text/javascript'>
// Checking if Full Screen API is supported by Broswer
if(document.fullScreenEnabled == true || document.mozFullScreenEnabled == true || document.webkitFullScreenEnabled == true)
{
//alert('Your browser supports Full Screen API') ;
}
var canvas1 = document.getElementById('canvas1') ;
var ctx = canvas1.getContext('2d') ;
ctx.fillStyle = "black" ;
ctx.fillRect(0,0,600,600) ;
if(canvas1.mozRequestFullScreen)
{
canvas1.mozRequestFullScreen();
}
else if(canvas1.webkitRequestFullScreen)
{
canvas1.webkitRequestFullScreen();
}
</script>
</body>
</html>