Menu Problems
2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 18, 2011 (RSS)
Hi Everyone
I know this may not be the most appropriate forum for my issue, but I thought someone might be able to help me. I am using CMSB for a condo corp website, specifically to display the Policy Manual. I have created a table of content menu system (file attached) which works very well. However, there is one problem. When I choose a TOC sub-item, the menu then collapses (see http://www.huntclubestates66.com/policyManual.php). I would like it not to collapse; otherwise it is very irritating because you can't easily tell where you were when reading a sub-menu item.
The TOC menu is controlled by a javascript function listed below.
This code was written months ago, and I've lost track of how to fix the issue![blush]
Help!
Ragi
I know this may not be the most appropriate forum for my issue, but I thought someone might be able to help me. I am using CMSB for a condo corp website, specifically to display the Policy Manual. I have created a table of content menu system (file attached) which works very well. However, there is one problem. When I choose a TOC sub-item, the menu then collapses (see http://www.huntclubestates66.com/policyManual.php). I would like it not to collapse; otherwise it is very irritating because you can't easily tell where you were when reading a sub-menu item.
The TOC menu is controlled by a javascript function listed below.
<script type="text/javascript">
CLOSED_IMAGE='images/toc-plus.png';
OPEN_IMAGE='images/toc-minus.png';
function makeCollapsible(listElement){
// removed list item bullets and the sapce they occupy
listElement.style.listStyle='none';
listElement.style.marginLeft='0';
listElement.style.paddingLeft='0';
// loop over all child elements of the list
var child=listElement.firstChild;
while (child!=null){
// only process li elements (and not text elements)
if (child.nodeType==1){
// build a list of child ol and ul elements and hide them
var list=new Array();
var grandchild=child.firstChild;
while (grandchild!=null){
if (grandchild.tagName=='OL' || grandchild.tagName=='UL'){
grandchild.style.display='none';
list.push(grandchild);
}
grandchild=grandchild.nextSibling;
}
// add toggle buttons
var node=document.createElement('img');
node.setAttribute('src',CLOSED_IMAGE);
node.setAttribute('class','collapsibleClosed');
node.onclick=createToggleFunction(node,list);
child.insertBefore(node,child.firstChild);
}
child=child.nextSibling;
}
}
function createToggleFunction(toggleElement,sublistElements){
return function(){
// toggle status of toggle gadget
if (toggleElement.getAttribute('class')=='collapsibleClosed'){
toggleElement.setAttribute('class','collapsibleOpen');
toggleElement.setAttribute('src',OPEN_IMAGE);
}else{
toggleElement.setAttribute('class','collapsibleClosed');
toggleElement.setAttribute('src',CLOSED_IMAGE);
}
// toggle display of sublists
for (var i=0;i<sublistElements.length;i++){
sublistElements.style.display=
(sublistElements.style.display=='block')?'none':'block';
}
}
}
</script>
This code was written months ago, and I've lost track of how to fix the issue![blush]
Help!
Ragi
--
northernpenguin
Northern Penguin Technologies
"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke
northernpenguin
Northern Penguin Technologies
"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke
Re: [northernpenguin] Menu Problems
By Jason - January 18, 2011
Hi Ragi,
Unfortunately, third party javascript is not something that we can support in the forum. If you'd like us to take a closer look at this, we can do so through our consulting service. Just send an email to consulting@interactivetools.com.
If anyone else in the community would like to take a look, that's an option as well.
Unfortunately, third party javascript is not something that we can support in the forum. If you'd like us to take a closer look at this, we can do so through our consulting service. Just send an email to consulting@interactivetools.com.
If anyone else in the community would like to take a look, that's an option as well.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/
Jason Sauchuk - Project Manager
interactivetools.com
Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/