-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Wu Stellan
committed
Jun 10, 2020
0 parents
commit fe671e4
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |