Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Wu Stellan committed Jun 10, 2020
0 parents commit fe671e4
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Iframe full screen</title>
<style>
img {
width: 100%;
}
button {
width: 200px;
height: 60px;
background: #fff;
}
</style>
</head>
<body>
<div>
<img src="https://media-preview.contentapi.ea.com/content/dam/eacom/en-us/common/ea-hero-md-play-steam-xl-7x2.jpg.adapt.1920w.jpg" alt="">
</div>
<button>Full Screen</button>
<script>
const button = document.querySelector('button');
const img = document.querySelector('img');

button.onclick = () => {
if (img.requestFullscreen) {
img.requestFullscreen();
} else if (img.webkitRequestFullscreen) {
img.webkitRequestFullscreen();
}
}
</script>
</body>
</html>

0 comments on commit fe671e4

Please sign in to comment.