(I do alright with CSS, but im a newbie to Javascript)
There, they use a combination of CSS styles ("collapsed") with Javascript (my best effort is onclick scripting?). What i like that I havent been able to replicate is that the lists can all be expanded without changing the current page. I see when hovering, the link generated isnt the direct link, but once we click on the link, it becomes a normal short link.
These are the 2 javascripts I've combined so far plus an example list item to show the CSS. If needed, I can send a link to my working example. Thanks for any ideas!
JavascriptS
<script type="text/javascript">
<!--
function show(inp,inp2){
if (document.all[inp].style.display == "block"){
document.all[inp].style.display = "none";
}
else {
document.all[inp].style.display = "block";
}
}
//-->
/* All of the following paramater are none mandatory*/
//mm_maxLevels=0; // parameter [INTEGER] to fix the number of menus displayed to the specified maximum value.
resetAutoOpen=true // parameter This bit allows the menu to re-open if sibling menus have been closed, displaying the menu again if required.
forceChildSubOpen=true // Forces the opening of a child sub menu if the opening item's URL matches the current page URL and also opens a sub menu
function _ocURL(){
var i,I,c;
_cip=new Array();
for(_b=0;_b<_mi.length;_b++)$q(_b)
if(_W.forceChildSubOpen){
_cln=_cip.length
for(c=0;c<_cln;c++){
if(_mi[_cip[c]][3]){
_mn=$h(_mi[_cip[c]][3])
_cip[_cip.length]=_m[_mn][0][0]
}
}
}
_ombcu=new Array()
if(_cip.length>0){
for(c=0;c<_cip.length;c++){
_ci=_cip[c];
_mni=$f(_ci);
if(_mni==-1)_mni=_ci
if(_mni+" "!=$u){
while(_mni!=-1){
_ombcu[_ombcu.length]=_mni
_mni=$f(_mni);
if(_mni+" "==$u)_mni=-1
}
}
}
}
if(_startM){
setTimeout("_ocURL()", 50)
}
else{
if(_W._lnk&&_lnk!=_jv)return false
if(_ombcu.length&&(_W.mm_maxLevels>0||_W.mm_maxLevels+" "==$u)){
for(_oma=_ombcu.length-1;_oma>-1;_oma--){
i=_ombcu[_oma];
I=_mi[i];
h$(i);
hidetip();
var M=_m[$h(I[3])]
if(!M[7])$K(i);
_ofMT=1;
if(I[32]){
_tI=$c("img"+i)
if(_tI&&I[29])_tI.src=I[29]
}
if(_oma==_W.mm_maxLevels)return
}
}
if(_ombcu.length){
d$(_ombcu[0])
hmL(_mi[_ombcu[0]][0])
}
}
}
_ocURL()
</script>
HTML W/CSS (so far, i manually change "display:none" to :inline on the current page)
<!-- START MAIN LEFT NAV DEFINITIONS -->
<dl id="menu">
<dt onclick="show('lo','loi');"><a href="#">First Menu Item</a></dt>
<dd id="smenu1">
<ul style="display:none" id="lo">
<li><a href="#">sub-menu 1.1</a></li>
<li><a href="#">sub-menu 1.2</a></li>
<li><a href="#">sub-menu 1.3</a></li>
</ul>
</dd>

New Topic/Question
Reply



MultiQuote





|