PizzaHut

Menu2

Sep 17th, 2015
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 3.41 KB | None | 0 0
  1. <html>
  2.     <head>
  3.    
  4.     <title>Thugnificent Pastrys</title>
  5.    
  6.     <style type="text/css">
  7.  body{background-image:url("pictures/maintwinkies.jpg");}
  8.    
  9. .menutitle{
  10. cursor:pointer;
  11. margin-bottom: 5px;
  12. background-color:#ECECFF;
  13. color:#000000;
  14. width:140px;
  15. padding:2px;
  16. text-align:center;
  17. font-weight:bold;
  18. /*/*/border:1px solid #000000;/* */
  19. }
  20.  
  21. .submenu{
  22. margin-bottom: 0.5em;
  23. }
  24. </style>
  25.  
  26. <script type="text/javascript">
  27.  
  28.  
  29. var persistmenu="yes" //"yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
  30. var persisttype="sitewide" //enter "sitewide" for menu to persist across site, "local" for this page only
  31.  
  32. if (document.getElementById){ //DynamicDrive.com change
  33. document.write('<style type="text/css">\n')
  34. document.write('.submenu{display: none;}\n')
  35. document.write('</style>\n')
  36. }
  37.  
  38. function SwitchMenu(obj){
  39.     if(document.getElementById){
  40.     var el = document.getElementById(obj);
  41.     var ar = document.getElementById("masterdiv").getElementsByTagName("span"); //DynamicDrive.com change
  42.         if(el.style.display != "block"){ //DynamicDrive.com change
  43.             for (var i=0; i<ar.length; i++){
  44.                 if (ar[i].className=="submenu") //DynamicDrive.com change
  45.                 ar[i].style.display = "none";
  46.             }
  47.             el.style.display = "block";
  48.         }else{
  49.             el.style.display = "none";
  50.         }
  51.     }
  52. }
  53.  
  54. function get_cookie(Name) {
  55. var search = Name + "="
  56. var returnvalue = "";
  57. if (document.cookie.length > 0) {
  58. offset = document.cookie.indexOf(search)
  59. if (offset != -1) {
  60. offset += search.length
  61. end = document.cookie.indexOf(";", offset);
  62. if (end == -1) end = document.cookie.length;
  63. returnvalue=unescape(document.cookie.substring(offset, end))
  64. }
  65. }
  66. return returnvalue;
  67. }
  68.  
  69. function onloadfunction(){
  70. if (persistmenu=="yes"){
  71. var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
  72. var cookievalue=get_cookie(cookiename)
  73. if (cookievalue!="")
  74. document.getElementById(cookievalue).style.display="block"
  75. }
  76. }
  77.  
  78. function savemenustate(){
  79. var inc=1, blockid=""
  80. while (document.getElementById("sub"+inc)){
  81. if (document.getElementById("sub"+inc).style.display=="block"){
  82. blockid="sub"+inc
  83. break
  84. }
  85. inc++
  86. }
  87. var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
  88. var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
  89. document.cookie=cookiename+"="+cookievalue
  90. }
  91.  
  92. if (window.addEventListener)
  93. window.addEventListener("load", onloadfunction, false)
  94. else if (window.attachEvent)
  95. window.attachEvent("onload", onloadfunction)
  96. else if (document.getElementById)
  97. window.onload=onloadfunction
  98.  
  99. if (persistmenu=="yes" && document.getElementById)
  100. window.onunload=savemenustate
  101.  
  102. </script>
  103.    
  104.     </head>
  105.         <body>
  106.    
  107.        
  108. <div id="masterdiv">
  109.  
  110.     <div class="menutitle" onclick="SwitchMenu('sub1')">Main</div>
  111.     <span class="submenu" id="sub1">
  112.         - <a href="map.html">Where are we located?</a><br>
  113.         - <a href="hot.htm">What's hot</a><br>
  114.     </span>
  115.  
  116.     <div class="menutitle" onclick="SwitchMenu('sub2')">Get to know me</div>
  117.     <span class="submenu" id="sub2">
  118.         - <a href="https://www.facebook.com/profile.php?id=100009467173090">Facebook</a><br>
  119.         - <a href="https://instagram.com/http.lilg/">Intsagram</a><br>
  120.     </span>
  121.  
  122.     <div class="menutitle" onclick="SwitchMenu('sub3')">Gaben</div>
  123.     <span class="submenu" id="sub3">
  124.         - <a href="http://gaben.amigocraft.net/">All Hail Gaben</a><br>
  125.     </span>
  126.    
  127. </div>
  128.        
  129.         </body>
  130. </html>
Advertisement
Add Comment
Please, Sign In to add comment