Created
February 7, 2016 00:41
-
-
Save javan/be0bfcfe237f7583d2e4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
padding: 60px; | |
} | |
.highlight { | |
background-color: yellow; | |
} | |
webview { | |
display: inline-block; | |
width: 200px; | |
height: 60px; | |
} | |
</style> | |
<script> | |
addEventListener("mousedown", function(event) { | |
if (event.target === document.body) { | |
document.body.classList.add("highlight") | |
} | |
}) | |
addEventListener("mouseup", function(event) { | |
if (event.target === document.body) { | |
document.body.classList.remove("highlight") | |
} | |
}) | |
</script> | |
</head> | |
<body> | |
<webview src="./webview.html"></webview> | |
</body> | |
</html> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<style> | |
body { | |
background-color: red; | |
} | |
.highlight { | |
background-color: yellow; | |
} | |
</style> | |
<script> | |
addEventListener("mousedown", function(event) { | |
if (event.target === document.body) { | |
document.body.classList.add("highlight") | |
} | |
}) | |
addEventListener("mouseup", function(event) { | |
if (event.target === document.body) { | |
document.body.classList.remove("highlight") | |
} | |
}) | |
</script> | |
</head> | |
<body> | |
<input type="text"> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment