Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.78 KB | None | 0 0
  1. function button1() {
  2. var btn = document.createElement("a");
  3. var btn2 = document.createElement("img");
  4. btn.setAttribute("href", "JavaScript:execFunction()");
  5. btn2.setAttribute("src", "http://www.thegaminghideout.com/VexIMG/triangleup", "style", "float: right;");
  6. document.btn.appendChild(btn2);
  7. document.body.appendChild(btn)
  8. }
  9.  
  10. function button2() {
  11. var btn = document.createElement("a");
  12. var btn2 = document.createElement("img");
  13. btn.setAttribute("href", "JavaScript:execFunction2()");
  14. btn2.setAttribute("src", "http://www.thegaminghideout.com/VexIMG/triangledown", "style", "float: right;")
  15. document.btn.appendChild(btn2);
  16. document.body.appendChild(btn);
  17. }
  18.  
  19. function execFunction() {
  20. removeLinks();
  21. linksAddSet1();
  22. }
  23.  
  24. function execFunction2() {
  25. removeLinks();
  26. linksAddSet2();
  27. }
  28.  
  29. function removeLinks() {
  30. var list = document.getElementById("output2");
  31. while (list.hasChildNodes()) {
  32. list.removeChild(list.lastChild);
  33. }
  34. }
  35.  
  36. function linksAddSet1() {
  37. var out = document.getElementById("output2");
  38. var args = ["About", "Games", "The Hideout", "Staff", "Donate", "Contact Us", ];
  39.  
  40. function displayMenu() {
  41. var ul = document.createElement('ul');
  42. ul.className = "mainMenu";
  43. args.forEach(function (name, index) {
  44. var li = document.createElement('li'),
  45. an = document.createElement('a');
  46. li.className = "mmenu-item-" + index;
  47. li.setAttribute = "link rel", "stylesheet", "type", "text/css", "href", "http://www.thegaminghideout.com/style.css";
  48. an.innerHTML = name;
  49. an.setAttribute('href', "http://www.thegaminghideout.com/" + name + ".html");
  50. li.appendChild(an);
  51. ul.appendChild(li);
  52. });
  53. out.appendChild(ul);
  54. }
  55. if (output2.childNodes.length > 0) {} else {
  56. displayMenu();
  57. }
  58. }
  59.  
  60. function linksAddSet2() {
  61. var list = document.getElementById("output2");
  62. var out = document.getElementById("output2");
  63. var args = ["Tools", "Tutorials"];
  64.  
  65. function displayMenu() {
  66. var ul = document.createElement('ul');
  67. ul.className = "mainMenu";
  68. args.forEach(function (name, index) {
  69. var li = document.createElement('li'),
  70. an = document.createElement('a');
  71. li.className = "mmenu-item-" + index;
  72. li.setAttribute = "link rel", "stylesheet", "type", "text/css", "href", "http://www.thegaminghideout.com/style.css";
  73. an.innerHTML = name;
  74. an.setAttribute('href', "http://www.thegaminghideout.com/" + name + ".html");
  75. li.appendChild(an);
  76. ul.appendChild(li);
  77. });
  78. out.appendChild(ul);
  79. }
  80. if (output2.childNodes.length > 0) {} else {
  81. displayMenu();
  82. }
  83. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement