login  Naam:   Wachtwoord: 
Registreer je!
 Forum

javascript menu

Offline pim1991 - 13/01/2006 17:41
Avatar van pim1991PHP interesse hallo ik heb een javascript menu van een tracker maar ik weet niet precies hoe ik deze in de tracker moet verwerken. het script doet het maar ik doe iets fout met het invoegen in de pagina. dit is de code. misschien kan iemand me zeggen hoe het wel moet 

  1. <html><body>
  2. <script language="Javascript" type="text/javascript" src="http://tracker.vvmaasbracht.nl/menuscript.js">


alvast bedankt 

2 antwoorden

Gesponsorde links
Offline Cosca - 13/01/2006 17:43
Avatar van Cosca HTML beginner je moet hem ook weer sluiten
  1. <html><body>
  2. <script language="Javascript" type="text/javascript" src="http://tracker.vvmaasbracht.nl/menuscript.js"></script>
Offline pim1991 - 13/01/2006 17:48
Avatar van pim1991 PHP interesse thx maar ik heb nu weer een ander probleem. het emnu doet het alleen ik heb niet de werking dat het moet doen. meestal zou hij submenu's hebben maar dat krijgt hij niet. hij zet alles onder elkaar. dit is de code. hulp is welkom 
  1. /*** SET BUTTON'S FOLDER HERE ***/
  2. var buttonFolder = "buttons/";
  3.  
  4. /*** SET BUTTONS' FILENAMES HERE ***/
  5. upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png","button5up.png","button6up.png","button7up.png");
  6.  
  7. overSources = new Array("button1over.png","button2over.png","button3over.png","button4over.png","button5over.png","button6over.png","button7over.png");
  8.  
  9. // SUB MENUS DECLARATION, YOU DONT NEED TO EDIT THIS
  10. subInfo = new Array();
  11. subInfo[1] = new Array();
  12. subInfo[2] = new Array();
  13. subInfo[3] = new Array();
  14. subInfo[4] = new Array();
  15. subInfo[5] = new Array();
  16. subInfo[6] = new Array();
  17. subInfo[7] = new Array();
  18.  
  19.  
  20. //*** SET SUB MENUS TEXT LINKS AND TARGETS HERE ***//
  21. subInfo[1][1] = new Array("Index","http://bitwarehouse.myftp.org/","");
  22. subInfo[1][2] = new Array("About","http://bitwarehouse.myftp.org/about.php","");
  23.  
  24. subInfo[2][1] = new Array("Browse","http://bitwarehouse.myftp.org/Browse.php","");
  25. subInfo[2][2] = new Array("Request","http://bitwarehouse.myftp.org/viewrequests.php","");
  26. subInfo[2][3] = new Array("Offer","http://bitwarehouse.myftp.org/viewoffers.php","");
  27. subInfo[2][4] = new Array("Catalogue","http://bitwarehouse.myftp.org/catalogue.php","");
  28. subInfo[2][5] = new Array("Upload","http://bitwarehouse.myftp.org/Upload.php","");
  29.  
  30. subInfo[3][1] = new Array("Forums","http://bitwarehouse.myftp.org/forums.php","");
  31. subInfo[3][2] = new Array("IRC","http://bitwarehouse.myftp.org/irc2.php","");
  32. subInfo[3][3] = new Array("Links","http://bitwarehouse.myftp.org/links.php","");
  33. subInfo[3][3] = new Array("Top 10","http://bitwarehouse.myftp.org/topten.php","");
  34.  
  35. subInfo[4][1] = new Array("Proflie","http://bitwarehouse.myftp.org/my.php","");
  36. subInfo[4][2] = new Array("Friends","http://bitwarehouse.myftp.org/friends.php","");
  37. subInfo[4][3] = new Array("Invite","http://bitwarehouse.myftp.org/invite.php","");
  38.  
  39. subInfo[5][1] = new Array("Donate","http://bitwarehouse.myftp.org/donate.php","");
  40. subInfo[5][2] = new Array("Nforce","http://bitwarehouse.myftp.org/newnfo.php","");
  41. subInfo[5][3] = new Array("Casino","http://bitwarehouse.myftp.org/casino.php","");
  42. subInfo[5][4] = new Array("Gallery","http://bitwarehouse.myftp.org/bitgallery.php","");
  43. subInfo[5][5] = new Array("Games","http://bitwarehouse.myftp.org/sitegames.php","");
  44.  
  45. subInfo[6][1] = new Array("Rules","http://bitwarehouse.myftp.org/rules.php","");
  46. subInfo[6][2] = new Array("FAQ","http://bitwarehouse.myftp.org/faq.php","");
  47. subInfo[6][3] = new Array("UserAgreement","http://bitwarehouse.myftp.org/useragreement.php","");
  48.  
  49. subInfo[7][1] = new Array("Contact","http://bitwarehouse.myftp.org/contactstaff.php","");
  50. subInfo[7][2] = new Array("Help","http://bitwarehouse.myftp.org/helpdesk.php","");
  51. subInfo[7][3] = new Array("Uploader App","http://bitwarehouse.myftp.org/uploadapp.php","");
  52. subInfo[7][4] = new Array("Staff","http://bitwarehouse.myftp.org/staff.php","");
  53.  
  54.  
  55. //*** SET SUB MENU POSITION ( RELATIVE TO BUTTON ) ***//
  56. var xSubOffset = 0;
  57. var ySubOffset = 22;
  58.  
  59.  
  60.  
  61. //*** NO MORE SETTINGS BEYOND THIS POINT ***//
  62. var overSub = false;
  63. var delay = 1000;
  64. totalButtons = upSources.length;
  65.  
  66. // GENERATE SUB MENUS
  67. for ( x=0; x<totalButtons; x++) {
  68. // SET EMPTY DIV FOR BUTTONS WITHOUT SUBMENU
  69. if ( subInfo[x+1].length < 1 ) {
  70. document.write('<div id="submenu' + (x+1) + '">');
  71. // SET DIV FOR BUTTONS WITH SUBMENU
  72. } else {
  73. document.write('<div id="submenu' + (x+1) + '" class="dropmenu" ');
  74. document.write('onMouseOver="overSub=true;');
  75. document.write('setOverImg(\'' + (x+1) + '\',\'\');"');
  76. document.write('onMouseOut="overSub=false;');
  77. document.write('setTimeout(\'hideSubMenu(\\\'submenu' + (x+1) + '\\\')\',delay);');
  78. document.write('setOutImg(\'' + (x+1) + '\',\'\');">');
  79.  
  80.  
  81. document.write('<ul>');
  82. for ( k=0; k<subInfo[x+1].length-1; k++ ) {
  83. document.write('<li>');
  84. document.write('<a href="' + subInfo[x+1][k+1][1] + '" ');
  85. document.write('target="' + subInfo[x+1][k+1][2] + '">');
  86. document.write( subInfo[x+1][k+1][0] + '</a>');
  87. document.write('</li>');
  88. }
  89. document.write('</ul>');
  90. }
  91. document.write('</div>');
  92. }
  93.  
  94.  
  95.  
  96.  
  97.  
  98. //*** MAIN BUTTONS FUNCTIONS ***//
  99. // PRELOAD MAIN MENU BUTTON IMAGES
  100. function preload() {
  101. for ( x=0; x<totalButtons; x++ ) {
  102. buttonUp = new Image();
  103. buttonUp.src = buttonFolder + upSources[x];
  104. buttonOver = new Image();
  105. buttonOver.src = buttonFolder + overSources[x];
  106. }
  107. }
  108.  
  109. // SET MOUSEOVER BUTTON
  110. function setOverImg(But, ID) {
  111. document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
  112. }
  113.  
  114. // SET MOUSEOUT BUTTON
  115. function setOutImg(But, ID) {
  116. document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
  117. }
  118.  
  119.  
  120.  
  121. //*** SUB MENU FUNCTIONS ***//
  122. // GET ELEMENT ID MULTI BROWSER
  123. function getElement(id) {
  124. return document.getElementById ? document.getElementById(id) : document.all ? document.all(id) : null;
  125. }
  126.  
  127. // GET X COORDINATE
  128. function getRealLeft(id) {
  129. var el = getElement(id);
  130. if (el) {
  131. xPos = el.offsetLeft;
  132. tempEl = el.offsetParent;
  133. while (tempEl != null) {
  134. xPos += tempEl.offsetLeft;
  135. tempEl = tempEl.offsetParent;
  136. }
  137. return xPos;
  138. }
  139. }
  140.  
  141. // GET Y COORDINATE
  142. function getRealTop(id) {
  143. var el = getElement(id);
  144. if (el) {
  145. yPos = el.offsetTop;
  146. tempEl = el.offsetParent;
  147. while (tempEl != null) {
  148. yPos += tempEl.offsetTop;
  149. tempEl = tempEl.offsetParent;
  150. }
  151. return yPos;
  152. }
  153. }
  154.  
  155. // MOVE OBJECT TO COORDINATE
  156. function moveObjectTo(objectID,x,y) {
  157. var el = getElement(objectID);
  158. el.style.left = x;
  159. el.style.top = y;
  160. }
  161.  
  162. // MOVE SUBMENU TO CORRESPONDING BUTTON
  163. function showSubMenu(subID, buttonID) {
  164. hideAllSubMenus();
  165. butX = getRealLeft(buttonID);
  166. butY = getRealTop(buttonID);
  167. moveObjectTo(subID,butX+xSubOffset, butY+ySubOffset);
  168. }
  169.  
  170. // HIDE ALL SUB MENUS
  171. function hideAllSubMenus() {
  172. for ( x=0; x<totalButtons; x++) {
  173. moveObjectTo("submenu" + (x+1) + "",-500, -500 );
  174. }
  175. }
  176.  
  177. // HIDE ONE SUB MENU
  178. function hideSubMenu(subID) {
  179. if ( overSub == false ) {
  180. moveObjectTo(subID,-500, -500);
  181. }
  182. }
  183.  
  184.  
  185.  
  186. //preload();


alvast bedankt!
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.354s