Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function button1() {
- var btn = document.createElement("a");
- var btn2 = document.createElement("img");
- btn.setAttribute("href", "JavaScript:execFunction()");
- btn2.setAttribute("src", "http://www.thegaminghideout.com/VexIMG/triangleup", "style", "float: right;");
- document.btn.appendChild(btn2);
- document.body.appendChild(btn)
- }
- function button2() {
- var btn = document.createElement("a");
- var btn2 = document.createElement("img");
- btn.setAttribute("href", "JavaScript:execFunction2()");
- btn2.setAttribute("src", "http://www.thegaminghideout.com/VexIMG/triangledown", "style", "float: right;")
- document.btn.appendChild(btn2);
- document.body.appendChild(btn);
- }
- function execFunction() {
- removeLinks();
- linksAddSet1();
- }
- function execFunction2() {
- removeLinks();
- linksAddSet2();
- }
- function removeLinks() {
- var list = document.getElementById("output2");
- while (list.hasChildNodes()) {
- list.removeChild(list.lastChild);
- }
- }
- function linksAddSet1() {
- var out = document.getElementById("output2");
- var args = ["About", "Games", "The Hideout", "Staff", "Donate", "Contact Us", ];
- function displayMenu() {
- var ul = document.createElement('ul');
- ul.className = "mainMenu";
- args.forEach(function (name, index) {
- var li = document.createElement('li'),
- an = document.createElement('a');
- li.className = "mmenu-item-" + index;
- li.setAttribute = "link rel", "stylesheet", "type", "text/css", "href", "http://www.thegaminghideout.com/style.css";
- an.innerHTML = name;
- an.setAttribute('href', "http://www.thegaminghideout.com/" + name + ".html");
- li.appendChild(an);
- ul.appendChild(li);
- });
- out.appendChild(ul);
- }
- if (output2.childNodes.length > 0) {} else {
- displayMenu();
- }
- }
- function linksAddSet2() {
- var list = document.getElementById("output2");
- var out = document.getElementById("output2");
- var args = ["Tools", "Tutorials"];
- function displayMenu() {
- var ul = document.createElement('ul');
- ul.className = "mainMenu";
- args.forEach(function (name, index) {
- var li = document.createElement('li'),
- an = document.createElement('a');
- li.className = "mmenu-item-" + index;
- li.setAttribute = "link rel", "stylesheet", "type", "text/css", "href", "http://www.thegaminghideout.com/style.css";
- an.innerHTML = name;
- an.setAttribute('href', "http://www.thegaminghideout.com/" + name + ".html");
- li.appendChild(an);
- ul.appendChild(li);
- });
- out.appendChild(ul);
- }
- if (output2.childNodes.length > 0) {} else {
- displayMenu();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement