(2)在某些情况下,菜单需要显示为默认值,即没有显示 子菜单。 如果您(或其他人)可以腾出时间看看这个 然后我会非常感激! 詹姆斯 Stephen, thanks for taking the time to help me out with this one, unfortunatlymy knowledge of javascript is rubbish, hense my asking for some help.Your ''kludge'' as you put it works great so thanks in advance! AlthoughI have a couple of other questions,.. is there an easy way to add thesetwo features... (1) The script is currently, held in an external javascript document,so is there any way of putting the ''StartWith'' trigger onto the page? (2) Also in some cases the menu needs to display as default i.e with nosub menu displayed. If you (or anyone else) could spare the time to have a look at thisthen I would be most grateful! James == == 显示 getNextSiblingByElement((activeMenu = document.getEl ementById(a.id)))。style.di getNextSiblingByElement((activeMenu=document.getEl ementById(a.id))).style.di Stephen, 谢谢花时间帮我解决这个问题,不幸的是我对javascript的了解是垃圾,hense我要求一些帮助。你提出的''kludge''很有效,所以提前感谢!虽然我还有其他一些问题,但是有一种简单的方法可以添加这两个功能...... (1)脚本目前在一个外部的javascript文档,那么有没有办法将''StartWith''触发器放到页面上? Stephen, thanks for taking the time to help me out with this one, unfortunatly my knowledge of javascript is rubbish, hense my asking for some help. Your ''kludge'' as you put it works great so thanks in advance! Although I have a couple of other questions,.. is there an easy way to add these two features... (1) The script is currently, held in an external javascript document, so is there any way of putting the ''StartWith'' trigger onto the page? 删除startWith的声明initMenu()函数,然后在包含菜单的页面中的脚本标记内定义 startWith: < script type =''text / javascript'' > var startWith = 1; < / script> (2)在某些情况下菜单需要显示为默认值,即没有显示子菜单。 Delete the declaration of startWith in the initMenu() function, then definestartWith within script tags in the page containing the menu: <script type=''text/javascript''>var startWith=1;</script> (2) Also in some cases the menu needs to display as default i.e with no sub menu displayed. 然后在这种情况下,将startWith指定为-1。 - SC http:// makeashorterlink。 com /?H3E82245A Then under those circumstances, assign startWith a value of -1. --S.C. http://makeashorterlink.com/?H3E82245A 这篇关于Javascript菜单修改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-26 11:37