Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ar = [ //---configuration array.
- //[ "sample", "http://url.to.sample/" ],
- [ "this very page", "index.html" ],
- [ "page2", "assets/NOWNOWNOWNOWNOW.gif" ],
- [ "page3", "index.html" ],
- [ "page4", "index.html" ],
- [ "page5", "index.html" ],
- [ "page6", "index.html" ],
- [ "page7", "index.html" ],
- [ "page8", "index.html" ],
- [ "page9", "assets/robotniks_ass.gif" ],
- [ "page10", "index.html" ],
- //[ "page11", "index.html" ],
- ];
- //---
- var col = 3; //static, number of columns, which will probably never change.
- var len = ar.length;
- function lenchk () {
- while ((len % col) > 0) {
- ++len;
- }
- }
- function genlnk () {
- for (var y = 0; y < col; ++y) {
- for (var x = y*(len/col); x < (1+y)*(len/col); ++x) {
- document.getElementById("ins" + y).innerHTML += "<a href='" + ar[x][1] + "'>" + ar[x][0] + "</a><br />";
- }
- }
- }
- function main () {
- lenchk();
- genlnk();
- }
- main();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement