473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

js menu for website - need customisation please.

6
Hey everyone,

Im sure that this will seriously be easy for one of you guys, but i am just no good with javascript (and more to the point the node hierarchy of html/xml)

Here is a javascript menu i sourced from www.javascriptkit.com

Expand|Select|Wrap|Line Numbers
  1.  var menuids=new Array("leftmenu") //Enter id(s) of UL menus, separated by commas
  2. var submenuoffset=-2 //Offset of submenus from main menu. Default is -2 pixels.
  3.  
  4. function createcssmenu(){
  5. for (var i=0; i<menuids.length; i++){
  6.   var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
  7.     for (var t=0; t<ultags.length; t++){
  8.     var spanref=document.createElement("span")
  9.         spanref.className="arrowdiv"
  10.         spanref.innerHTML="&nbsp;&nbsp;"
  11.         ultags[t].parentNode.getElementsByTagName("a")[0].appendChild(spanref)
  12.     ultags[t].parentNode.onmouseover=function(){
  13.     this.getElementsByTagName("ul")[0].style.left=this.parentNode.offsetWidth+submenuoffset+"px"
  14.     this.getElementsByTagName("ul")[0].style.display="block"}
  15.  
  16.     ultags[t].parentNode.onmouseout=function(){
  17.     this.getElementsByTagName("ul")[0].style.display="none"
  18.     }
  19.     }
  20.   }
  21. }
  22.  
  23.  
  24. if (window.addEventListener)
  25. window.addEventListener("load", createcssmenu, false)
  26. else if (window.attachEvent)
  27. window.attachEvent("onload", createcssmenu) 
Which is an external file to the html. Now with this and my <ul>'s and therefore <li>'s i can get a 2 level menu. Which is almost perfect. I need another level of depth. I need the menu to be able to provide 3 levels of menu.

Now i know how everyone (me too) hates people just asking without trying to write some code. But believe me i have tried, unsuccessfuly. I just seriously suck at this type of coding. I am sorry :(.

If anyone can help that would be fantastic - please .

Thanks alot everyone.
Mar 13 '07 #1
2 1324
acoder
16,027 Expert Mod 8TB
In this case, I would suggest you just get another one that already supports multi-levels. I don't endorse any of them, but here's a link.
Mar 13 '07 #2
acoder
16,027 Expert Mod 8TB
Altered title slightly
Mar 13 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another...
1
by: BG | last post by:
We need to put a menu on a page on our website. The menu has to be in the vertical area of a frames page. Go to www.fqvictims.org . The menu choices on the left need to be categorized - and we...
3
by: ACaunter | last post by:
Hi there, can someone please tell me what the easiest way to have a dropdown menu bar positioned on the screen (eg. Home, company, ... , contact us) then when the mouse goes over then, the sub...
6
by: Deborah | last post by:
I'm a rookie, and I guess I know just enough to be dangerous. I found a great template website, openwebsign.org, and found an open source template I really liked that even came in 2 versions. ...
0
by: Garmt de Vries-Uiterweerd | last post by:
X-posted to opera.page-authoring, because this is a bit Opera-specific for the moment. F'up to ciwas. I am playing around with dedicated styling for the projection media type.. Currently the...
4
by: rsteph | last post by:
I've found a javascript menu download, I've been tweaking it within a testpage, and getting it to look just right. I finally got everything looking right, all I have to do is alter where the links...
1
by: Anthony | last post by:
Below is a script I found at http://javascript.internet.com/ for a cascading menu. The script works great but there is one thing that I would like modified. BecauseI am just learning javascript,...
2
by: Wayne | last post by:
I know that it is possible to force Access 2007 to the display custom menu bars for an Access database developed in an earlier version by using the customisation settings in A2007 to nominate a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.