A Pen by Aled Wassell on CodePen.
Created
June 5, 2016 03:15
-
-
Save aledwassell/7514cee26b4b549acc8c2c88cc24ed30 to your computer and use it in GitHub Desktop.
looking at getting screen width, height and history
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
<body> | |
<div id="info"></div> | |
</body> |
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
var msg = '<h2>browser window</h2><p></p>width: ' + window.innerWidth + '</p>'; | |
msg += '<p>height: ' + window.innerHeight + '</p>'; | |
msg += '<h2>history</h2><p>items: ' + window.history.length + '</p>'; | |
msg += '<h2>screen</h2><p>width:' + window.screen.width + '</P>'; | |
msg += '<p>height: ' + window.screen.height + '</p>'; | |
var el = document.getElementById('info'); | |
el.innerHTML = msg; | |
alert('Current page: ' + window.location); |
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
@import bourbon | |
@import url(https://fonts.googleapis.com/css?family=Slabo+27px) | |
body | |
background-color: #aa5555 | |
text-align: center | |
font-family: Helvetica, sans-serif, arial | |
font-size: 1.5em | |
h2 | |
font-family: 'Slabo 27px' | |
color: #f2f2f2 | |
background: #6a6a6a | |
margin: 0 auto | |
width: 50% | |
box-shadow: 0px 0px 12px -5px rgba(0, 0, 0, 12) | |
box-shadow: 0px 12px 12px -5px rgba(0, 0, 0, .24) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just messing around o a Sunday morning