Advertisement
andrew35133

What I have so far

Jun 19th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Settings
  2. var window = http://mc.zephyrgaming.net/Dynmap/;
  3. var tabname = Dynmap;
  4. var imgloc = Images/map.png;
  5. var placement = 3;
  6.  
  7. //Tab on left side of page
  8.  
  9. //Change "tabname" to "whatever".  Tabname is what you see on the tab
  10. var img = document.createElement("img");
  11. //Change map.png to your own icon image.  Located in Modern/Images/
  12. img.setAttribute("src", "imgloc");
  13. img.setAttribute("alt", "tabname");
  14.  
  15. var span = document.createElement("span");
  16. span.innerHTML = "tabname";
  17.  
  18. var link = document.createElement("a");
  19. link.setAttribute("class", "sidetab");
  20. link.setAttribute("href","#tab_tabname");
  21. link.setAttribute("id", "tabhead_tabname");
  22.  
  23. link.appendChild(img);
  24. link.appendChild(span);
  25.  
  26. var sidetabs = document.getElementById("sidetabs");
  27. //change this 3 to which row you want 5th down would be 6, 7th down would be 8
  28. var after_link = sidetabs.getElementsByTagName("a")[placement];
  29. sidetabs.insertBefore(link, after_link);
  30.  
  31. //Page Content
  32. //Main Div
  33. var tabdiv = document.createElement("div");
  34. tabdiv.setAttribute("class", "tabarea");
  35. tabdiv.setAttribute("id", "tab_tabname");
  36. tabdiv.innerHTML = ("<h3>tabname</h3>");
  37. //Iframe
  38. var tabiframe = document.createElement("iframe");
  39. tabiframe.setAttribute("src",  "window");
  40. tabiframe.setAttribute("height", "500px");
  41. tabiframe.setAttribute("width", "100%");
  42. //Second Div
  43. var tabconents = document.createElement("div");
  44. tabconents.setAttribute("class", "tabcontents");
  45. //Third Div
  46. var maparea = document.createElement("div");
  47. maparea.setAttribute("id", "maparea")
  48.  
  49. maparea.appendChild(tabiframe);
  50. tabconents.appendChild(maparea);
  51. tabdiv.appendChild(tabconents);
  52.  
  53. tabs.appendChild(tabdiv);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement