Created
November 12, 2015 23:12
-
-
Save HSchmale16/98e217d2a1c2a8cdc478 to your computer and use it in GitHub Desktop.
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
<html> | |
<head> | |
<meta charset=utf-8> | |
<title>Some Thing</title> | |
<style> | |
body { | |
width: 400px; | |
} | |
.menuButton { | |
width: 45%; | |
height: 30%; | |
margin: 2.5%; | |
background-color: #EEE; | |
color: #107; | |
float: left; | |
font-size: 20pt; | |
position: relative; | |
} | |
.menuButton p{ | |
margin: 0; | |
position: absolute; | |
top: 50%; | |
left: 50%; | |
margin-right: -50%; | |
transform: translate(-50%, -50%); | |
} | |
</style> | |
<script> | |
var t = { | |
home: [ | |
{text: 'Hi'}, | |
{text: 'Hello'}, | |
{text: 'Life'}, | |
{text: 'Hallo'}, | |
{text: 'Something'}, | |
{text: 'LaLa'}, | |
{text: 'Yadda Yadda'} | |
] | |
}; | |
window.onload = function(){ | |
function layout(ele, idx, arr){ | |
var elem = document.createElement('div'); | |
elem.innerHTML = '<p>' + ele.text + '</p>'; | |
elem.className = 'menuButton'; | |
document.body.appendChild(elem); | |
} | |
t.home.forEach(layout); | |
} | |
</script> | |
</head> | |
<body> | |
</body> | |
</html> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment