Skip to content

Instantly share code, notes, and snippets.

@aledwassell
Created June 5, 2016 03:15
Show Gist options
  • Save aledwassell/7514cee26b4b549acc8c2c88cc24ed30 to your computer and use it in GitHub Desktop.
Save aledwassell/7514cee26b4b549acc8c2c88cc24ed30 to your computer and use it in GitHub Desktop.
looking at getting screen width, height and history
<body>
<div id="info"></div>
</body>
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);
@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)
@aledwassell
Copy link
Author

Just messing around o a Sunday morning

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment