Jump to content

bolognese

Members
  • Posts

    4
  • Joined

  • Last visited

About bolognese

  • Birthday 09/10/1966

Contact Methods

  • Website URL
    http://vanderburgt.eu/homepageinenglish.html.html
  • ICQ
    0

Profile Information

  • Location
    Netherlands

bolognese's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. This menu only seems to work if I have a link in every menu item, also those where I am supposed to choose from a submenu. My site is a personal one and I don't have that much useful html pages to put in those list items too.
  2. So menu once was a real attribute? Never thought of that.Thanks for your reply. I'll give it a try.
  3. Hello,Last week I found a nice javascript based cascading menu, which would look good on my website.I am used to let my site validate by the w3c validator, since I want to have my site in xhtml/css. I have only one problem left, so the validator tells me, but I don't know how to get rid of it, because I can read javascript and sometimes edit it, but rewrite a script is a bit too difficult for me.The cascading menu consists of many div's, each one representing a menu item. The div's are identified by an attribute "menu=##" which of course is bad for xhtml, but essential for the the script.I myself have solved kinda like problems on forms containing the deprecated attribute name: getelementbyid was the solution. But I don't think this is going to work now. Is there a way to remove the menu attribute and pass the id to the js script?I also found out that Firefox doesn't like it at all, while it does work in Internet Explorer.Here is some code:The Div's: <DIV Id="menuBar" class="menuBar" > <DIV Id="Bar1" class="Bar" menu="menu1">Menu #1</DIV> <DIV Id="Bar2" class="Bar" menu="menu2">Menu #2</DIV> <DIV Id="Bar3" class="Bar" menu="menu3">Menu #3</DIV> <DIV Id="Bar4" class="Bar" menu="menu4">Menu #4</DIV></DIV><!--MenuItem Definition --><div Id="menu1" class="menu" > <div Id="menuItem1_1" class="menuItem" menu="menu6">SubMenu #1</div> <div Id="menuItem1_2" class="menuItem" title="JavaScripts" cmd="http://javascript.internet.com/">JavaScript Source</div> <div Id="menuItem1_3" class="menuItem" title="WDVL" cmd="http://www.wdvl.com">WDVL</div></div><div Id="menu2" class="menu"> <div Id="menuItem2_1" class="menuItem">Page #1</div> <div Id="menuItem2_2" class="menuItem">Page #2</div> <div Id="menuItem2_3" class="menuItem">Page #3</div></div><div Id="menu3" class="menu"> <div Id="menuItem3_1" class="menuItem">Page #1</div> <div Id="menuItem3_2" class="menuItem">Page #2</div> <div Id="menuItem3_3" class="menuItem">Page #3</div> <div Id="menuItem3_4" class="menuItem" menu="menu5">SubMenu #4</div></div><div Id="menu4" class="menu"> <div Id="menuItem4_1" class="menuItem">Page #1</div> <div Id="menuItem4_2" class="menuItem">Page #2</div> <div Id="menuItem4_3" class="menuItem">Page #3</div> <div Id="menuItem4_4" class="menuItem">Page #4</div></div><div id="menu5" class="menu"> <div Id="menuItem5_1" class="menuItem">Page #4-1</div> <div Id="menuItem5_2" class="menuItem">Page #4-2</div> <div Id="menuItem5_3" class="menuItem">Page #4-3</div></div><div id="menu6" class="menu"> <div Id="menuItem6_1" class="menuItem">Page #1-1</div> <div Id="menuItem6_2" class="menuItem">Page #1-2</div> <div Id="menuItem6_3" class="menuItem" menu="menu7">SubMenu #1-1</div></div><div id="menu7" class="menu"> <div Id="menuItem7_1" class="menuItem">Page #1-1-1</div> <div Id="menuItem7_2" class="menuItem">Page #1-1-2</div> <div Id="menuItem7_3" class="menuItem">Page #1-1-3</div></div><!-- End of Menu --> And the scripting part (.js file): function InitMenu() { var bar = menuBar.children for(var i=0;i < bar.length;i++) { var menu=eval(bar[i].menu) menu.style.visibility = "hidden" bar[i].onmouseover = new Function("ShowMenu("+bar[i].id+")") var Items = menu.children for(var j=0; j<Items.length; j++) { var menuItem = eval(Items[j].id) if(menuItem.menu != null) { menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'>4</Span>" //var tmp = eval(menuItem.id+"_Arrow") // tmp.style.pixelLeft = menu.getBoundingClientRect().Right //- tmp.offsetWidth - 15 FindSubMenu(menuItem.menu)} if(menuItem.cmd != null) { menuItem.onclick = new Function("Do("+menuItem.id+")") } menuItem.onmouseover = new Function("highlight("+Items[j].id+")") } } } function FindSubMenu(subMenu) { var menu=eval(subMenu) var Items = menu.children for(var j=0; j<Items.length; j++) { menu.style.visibility = "hidden" var menuItem = eval(Items[j].id) if(menuItem.menu!= null) { menuItem.innerHTML += "<Span Id="+menuItem.id+"_Arrow class='Arrow'>4</Span>" // var tmp = eval(menuItem.id+"_Arrow") //tmp.style.pixelLeft = 35 //menuItem.getBoundingClientRect().right - tmp.offsetWidth - 15 FindSubMenu(menuItem.menu) } if(menuItem.cmd != null) { menuItem.onclick = new Function("Do("+menuItem.id+")") } menuItem.onmouseover = new Function("highlight("+Items[j].id+")") } } function ShowMenu(obj) { HideMenu(menuBar) var menu = eval(obj.menu) var bar = eval(obj.id) bar.className="barOver" menu.style.visibility = "visible" menu.style.pixelTop = obj.getBoundingClientRect().top + obj.offsetHeight + Bdy.scrollTop menu.style.pixelLeft = obj.getBoundingClientRect().left + Bdy.scrollLeft } function highlight(obj) { var PElement = eval(obj.parentElement.id) if(PElement.hasChildNodes() == true) { var Elements = PElement.children for(var i=0;i<Elements.length;i++) { TE = eval(Elements[i].id) TE.className = "menuItem" } } obj.className="ItemMouseOver" window.defaultStatus = obj.title ShowSubMenu(obj) } function Do(obj) { var cmd = eval(obj).cmd window.navigate(cmd) } function HideMenu(obj) { if(obj.hasChildNodes()==true) { var child = obj.children for(var j =0;j<child.length;j++) { if (child[j].className=="barOver") {var bar = eval(child[j].id) bar.className="Bar"} if(child[j].menu != null) { var childMenu = eval(child[j].menu) if(childMenu.hasChildNodes()==true) HideMenu(childMenu) childMenu.style.visibility = "hidden" } } } } function ShowSubMenu(obj) { PMenu = eval(obj.parentElement.id) HideMenu(PMenu) if(obj.menu != null) { var menu = eval(obj.menu) menu.style.visibility = "visible" menu.style.pixelTop = obj.getBoundingClientRect().top + Bdy.scrollTop menu.style.pixelLeft = obj.getBoundingClientRect().right + Bdy.scrollLeft if(menu.getBoundingClientRect().right > window.screen.availWidth ) menu.style.pixelLeft = obj.getBoundingClientRect().left - menu.offsetWidth } } ///////////////////CascadedDropdown Menu///////////////// //Date : 08/09/2001 // //Version : 1.0 // //Author Mr.Arun N Kumar // //EMail: n_arunk@hotmail.com // ///////////////////////////////////////////////////////// // Modifications on this code is not recomended // Suggestions are welcome This is my internet site:http://vanderburgt.euThanks in advance for any help.Jos
×
×
  • Create New...