Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old June 16th, 2004, 08:28 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
Help change code to fit my needs

I am panning on using the below code on a website I am making, however I need for the code to fit into where I want the images assosated with the code to be placed where the javascript is located in my HTML file. Thanks for anyhelp you can give me.

Below is the HTML Code:

php Code:
Original - php Code
  1. <HTML>
  2. <Head>
  3. <!-- Below is the javacode for image rollover -->
  4. <SCRIPT LANGUAGE="JavaScript">
  5. home = new Image();
  6. home.src = "images/home_rollover.gif";
  7.  
  8. staff = new Image();
  9. staff.src = "images/staff_rollover.gif";
  10. </script>
  11.  
  12. <!-- Below is the code for the menu -->
  13. <script language="javascript" src="Config.js"></script>
  14. <script language="javascript" src="Menu.js"></script>
  15. </header>
  16. <Body BGCOLOR='#000000'>
  17. <CENTER>
  18. <!-- Below is the code for the toolbar -->
  19. <Table cellpadding="0" cellspacing="0" border="0">
  20. <tr>
  21. <td>
  22. <img BORDER="0"  src='images/lt_end.gif'>
  23.   </td>
  24.    <td>
  25.      <a href="index.php" onmouseover="home.src='images/home_rollover.gif';"onmouseout="home.src='images/home.gif';"><img name="home" src="images/home.gif" border=0></a>
  26.    </td>
  27.    <td>
  28.      <img BORDER="0" src='images/spacer.gif'>
  29.    </td>
  30.    <td>
  31.      <SCRIPT LANGUAGE="JavaScript">
  32.     <!-- Begin
  33.     AddMenu("1"  ,  "1"   ,  ""       ,  "images/pictures.gif"  ,  "images/pictures_rollover.gif"  , "");
  34.     AddMenu("2"  ,  "1"   ,  "Me"       ,  ""  ,  ""  , "http://www.javascriptsource.com");   
  35.     AddMenu("3"  ,  "1"   ,  "Trip to Vegas"      ,  ""  ,  ""  , "http://www.javascriptsource.com");
  36.     AddMenu("4"  ,  "1"   ,  "Star Trek"        ,  ""  ,  ""  , "http://www.javascriptsource.com");
  37.     AddMenu("5"  ,  "1"   ,  "Random Pictures"       ,  ""  ,  ""  , "http://www.javascriptsource.com");   
  38.     Build();
  39.     //  End -->
  40.     </script>
  41.    </td>
  42.    <td>
  43.      <img BORDER="0" src='images/middle.gif'>
  44.    </td>
  45.    <td>
  46.      <a href="staff/" onmouseover="staff.src='images/staff_rollover.gif';"onmouseout="staff.src='images/staff.gif';"><img name="staff" src="images/staff.gif" border=0></a>
  47.    </td>
  48.    <td>
  49.      <img BORDER="0" src='images/rt_end.gif'>
  50.    </td>
  51.  </tr>
  52. </Table>
  53. </Center>
  54. </Body>
  55. </HTML>


here is the Config.js
php Code:
Original - php Code
  1. //Author: Younes Bouab
  2. //Date:   05-02-02
  3. //Title:  Menu Configuration: Config.js
  4. //
  5. //Copyright: Younes Bouab 2001
  6. //Technical Support: bouaby@SUPEReDITION.com
  7. //
  8. /////////////////////////////////////////////////////////////////////////////////////
  9. //Copyright (c) 2002 Younes Bouab (www.SUPEReDITION.com) Version 1.0
  10. //
  11. //Eperience the DHTML Menu - Get it at www.SUPEReDITION.com
  12. //
  13. //This script can be used freely as long as all copyright messages are intact.
  14. //
  15. //Menu HomePage: http://www.superedition.com/Main.asp?Page=Tutorials&query=Javascript
  16. //////////////////////////////////////////////////////////////////////////////////////
  17. //Menu Configuration File
  18. /////////////////////////////////////////////////
  19. /////You can change the value of a variable
  20. /////below or turn it off by making it equal ""
  21. /////to suit your needs, but you should not
  22. /////delete any variable.
  23. ///////////////////////////////////////////////
  24. /**********************************************/
  25. //Menu Type: Do Not Change!
  26. /**********************************************/
  27. MENU_TYPE=1; //1: Horizental
  28.              //2: Vertical
  29.  
  30. Sort=0;   //Sort: When set to 1, the
  31.           //menu items are sorted according
  32.           //to the index value. This feature
  33.           //can be used when a server side
  34.           //language (asp. jsp. php,...)
  35.           //is used to generate the menu items
  36.           //from a database and they are not always
  37.           //in order. 
  38.  
  39.  
  40.  
  41. /**********************************************/
  42. //Menu Starting point
  43. /**********************************************/
  44. TOP=50;
  45. LEFT=50;
  46.  
  47.  
  48. /**********************************************/
  49. //Menu item Dimension
  50. /**********************************************/
  51. WIDTH=69;
  52. HEIGHT=30;
  53.  
  54.  
  55. /**********************************************/
  56. //Layers Alignment
  57. /**********************************************/
  58. HALIGN="LEFT";
  59. VALIGN="MIDDLE";
  60.  
  61.  
  62. /**********************************************/
  63. //Global Menu Settings for all
  64. /**********************************************/
  65. //Main Menu Items
  66. LayerColor="#FFFFFF";
  67. LayerRollColor="#CCCCCC";
  68. FONT="verdana";
  69. FONTSIZE="1";
  70. FONTSTYLE="" // "": Normal, "B": Bold, "I": Italic
  71. FONTCOLOR="#000033";
  72. ROLL_FONTCOLOR="#000000";
  73. START_CHAR="-"; //Starting Character
  74.  
  75.  
  76. /**********************************************/
  77. //Main Parent Settings: Optional
  78. // leave empty "", if you would like to use
  79. // the Global Menu Settings above
  80. /**********************************************/
  81. Main_Parent_LayerColor="";
  82. Main_Parent_LayerRollColor="";
  83. Main_Parent_FONT="verdana";
  84. Main_Parent_FONTSTYLE="";
  85. Main_Parent_FONTSIZE="";
  86. Main_Parent_FONTCOLOR="";
  87. Main_Parent_ROLL_FONTCOLOR="";
  88. Main_Parent_START_CHAR="";
  89.  
  90.  
  91. /**********************************************/
  92. //Layer Border Properties
  93. /**********************************************/
  94. LayerBorderSize="1";
  95. LayerBorderStyle="solid";
  96. LayerBorderColor="#000000";
  97.  
  98.  
  99. /**********************************************/
  100. //Menu Children Offsets
  101. /**********************************************/
  102. TOP_OFFSET=0;
  103. LEFT_OFFSET=0;


and here is Menu.js

php Code:
Original - php Code
  1. //Author: Younes Bouab
  2. //Date:   03-05-01
  3. //Title:  Menu Generator: Menu.js
  4. //Copyright: Younes Bouab 2001
  5. //Technical Support: bouaby@SUPEReDITION.com
  6. ////////////////////////////////////////////
  7. ////////////////////////////////////////////
  8. //DO NOT CHANGE ANYTHING IN THIS FILE!
  9. //"Config.js" is the file you can edit
  10. ////////////////////////////////////////////
  11.  
  12. /*******************************************/
  13. //Dreamweaver Show/Hide/Obj Layer functions
  14. /*******************************************/
  15. function showHideLayers() {
  16.   var i,p,v,obj,args=showHideLayers.arguments;
  17.   for (i=0; i<(args.length-2); i+=3) if ((obj=findObj(args[i]))!=null) { v=args[i+2];
  18.     if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
  19.     obj.visibility=v; }
  20. }
  21. function findObj(n, d) {
  22.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  23.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  24.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  25.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=findObj(n,d.layers[i].document);
  26.   if(!x && document.getElementById) x=document.getElementById(n); return x;
  27. }
  28. function changeProp(objName,x,theProp,theValue) {
  29.   var obj = findObj(objName);
  30.   if (obj && (theProp.indexOf("style.")==-1 || obj.style)) eval("obj."+theProp+"='"+theValue+"'");
  31. }
  32.  
  33. function reloadPage(init) {
  34.   if (init==true) with (navigator)
  35.   {
  36.     if ((appName=="Netscape")&&(parseInt(appVersion)==4))
  37.     {
  38.       document.pgW=innerWidth;
  39.       document.pgH=innerHeight;
  40.       onresize=reloadPage;
  41.     }
  42.   }
  43.   else if (innerWidth!=document.pgW || innerHeight!=document.pgH) {location.reload();}
  44. }
  45. reloadPage(true);
  46.