Created
October 3, 2014 06:29
-
-
Save StoneCypher/b1d3871bdac0fe3e9d11 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
| function makeBoard(host, subx, suby) { | |
| var i,j, | |
| sz = subx * suby; | |
| for (j=0; j<sz; ++j) { | |
| var div = document.createElement('div'); | |
| for (i=0; i<sz; ++i) { | |
| var inp = document.createElement('input'); | |
| inp.id = 'input_' + x.toString() + '_' + y.toString(); | |
| var cellClass; | |
| if ((i % subx) === 0) { cellClass = 'leftHeavy'; } | |
| if ((j % suby) === 0) { cellClass = 'topHeavy'; } | |
| inp.className = cellClass; | |
| div.appendChild(inp); | |
| } | |
| host.appendChild(div); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment