Code:
<link type="text/css" href="{{=URL(r=request,c='static',f='menu_a/menu.css')}}" rel="stylesheet" />
<script src="{{=URL(r=request,c='static',f='menu_a/menu.js')}}" type="text/javascript"></script>
<script type="text/javascript">
ddaccordion.init({
headerclass: "expandable", //Shared CSS class name of headers group that are expandable
contentclass: "categoryitems", //Shared CSS class name of contents group
revealtype: "clickgo", //Reveal content when user clicks or onmouseover the header? Valid value: "click", "clickgo", or "mouseover"
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [0], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["", "openheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["prefix", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})
ddaccordion.init({ //2nd level headers initialization
headerclass: "subexpandable", //Shared CSS class name of sub headers group that are expandable
contentclass: "subcategoryitems", //Shared CSS class name of sub contents group
revealtype: "clickgo", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover
mouseoverdelay: 200, //if revealtype="mouseover", set delay in milliseconds before header expands onMouseover
collapseprev: true, //Collapse previous content (so only one open at any time)? true/false
defaultexpanded: [], //index of content(s) open by default [index1, index2, etc]. [] denotes no content
onemustopen: false, //Specify whether at least one header should be open always (so never all headers closed)
animatedefault: false, //Should contents open by default be animated into view?
persiststate: true, //persist state of opened contents within browser session?
toggleclass: ["opensubheader", "closedsubheader"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively ["position", "html1", "html2"] (see docs)
animatespeed: "fast", //speed of animation: integer in milliseconds (ie: 200), or keywords "fast", "normal", or "slow"
oninit:function(headers, expandedindices){ //custom code to run when headers have initalized
//do nothing
},
onopenclose:function(header, index, state, isuseractivated){ //custom code to run whenever a header is opened or closed
//do nothing
}
})
</script>
<!---Tab menu-->
<div class="arrowlistmenu">
{{rows = db((db.category.active==True) & (db.category.position.like('%VMENU%')) & (db.category.parent==None)).select(orderby=db.category.pos)}}
{{for row in rows:}}
{{url = URL(r=request, c='news', f='news_show', args=[row.code, row.id]) if row.url==None else row.url}}
{{rs = db((db.category.active==True) & (db.category.position.like('%VMENU%')) & (db.category.parent==row.id)).select(orderby=db.category.pos)}}
{{if len(rs)>0:}}
<h3 class="menuheader expandable">{{=A(SPAN(row.name), _href=url)}}</h3>
<ul class="categoryitems">
{{for r in rs:}}
{{url = URL(r=request, c='news', f='news_show', args=[r.code, r.id]) if r.url==None else r.url}}
{{cs = db((db.category.active==True) & (db.category.position.like('%%')) & (db.category.parent==r.id)).select(orderby=db.category.pos)}}
{{if len(cs)>0:}}
<li>{{=A(r.name, _href=url, _class="subexpandable")}}
<ul class="subcategoryitems" style="margin-left: 15px">
{{for c in cs:}}
{{url = URL(r=request, c='news', f='news_show', args=[c.code, c.id]) if c.url==None else c.url}}
<li>{{=A(c.name, _href=url, _style="font-weight:normal;")}}</li>
{{pass}}
</ul>
</li>
{{else:}}
<li>{{=A(r.name, _href=url)}}</li>
{{pass}}
{{pass}}
</ul>
{{else:}}
<h3 class="menuheader">{{=A(SPAN(row.name), _href=url)}}</h3>
{{pass}}
{{pass}}
</div>
Thanks
Bookmarks