Skip to content

Instantly share code, notes, and snippets.

@wmantly
Created July 5, 2014 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wmantly/6f25bb959029eaae0095 to your computer and use it in GitHub Desktop.
Save wmantly/6f25bb959029eaae0095 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<style type="text/css">
*{
padding: 0;
margin: 0;
}
#board{
/*padding: 50px;*/
border: 2px #000000 dotted;
display: inline-block;
}
.boardTile{
height: 16px;
width: 16px;
padding: 0px;
margin: 0px;
float: left;
}
#menu{
position: fixed;
top: 20px;
right: 0px;
margin-right: 15px;
border: 1px #000000 dotted;
height: 400px;
width: 40px;
background-color: #7a00aa;
z-index: 1000;
}
</style>
</head>
<body>
<div id='menu'>
<p>
one
</p>
<p>
two
</p>
<p>
tree
</p>
</div>
<div id="board"></div>
</body>
<script type="text/javascript">
(function(){
var height = 10;
var width = 10;
var boxHeight = 16;
var boxWidth = 16;
var boxElement = function(x,y){
return '<span id="' + x + '_' + y + '" class="boardTile"></span>';
}
var tempBoard = '';
for( var heightInt = 0; heightInt < height; heightInt++ ){
for( var widthInt = 0; widthInt < width; widthInt++ ){
tempBoard += boxElement( heightInt, widthInt );
}
tempBoard += '<br />';
}
$( '#board' ).append( tempBoard );
})();
$( document ).ready(function(){
$( '#5_5' ).html( 'HIIII' );
})
</script>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment