PDA

View Full Version : help me about clickgo in Bullet List Accordion Menu with nested levels



tandn
08-03-2010, 07:52 AM
1) Script Title: clickgo problem Bullet List Accordion Menu with nested levels in IE

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordionmenu-bullet.htm

3) Describe problem: I used realtype "clickgo" . In IE , the menu always open the defaultexpande every my mouse click
ex, if i set defaulexpand is the first. Then menu always open the first regard I click on another menuheader.
Please help,
I'm sorry if my english make you uncomfortable :p

tandn
08-03-2010, 10:47 AM
Any one, any idea , That's seem I ask a wrong question?

Beverleyh
08-03-2010, 10:49 AM
PLease provide a link to your site so we can see your own individual setup.

tandn
08-03-2010, 02:41 PM
Yes
Here it is http://huyenquephong.vn/
I want to say the vertical on the left side.
The problem occur in IE.
And here is content of the vertical left menu


<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

Beverleyh
08-03-2010, 02:53 PM
For starters, the link to the css file and javascript call to the menu is in your body section - they should be in your head section.

Double check the code in the example page here on DD and make changes based on that.

tandn
08-04-2010, 06:37 AM
In web2py framework , massimo provide web2py_ajax that already include jquery.js
so in my project, I included jquery.js file 2 times.
I have modified and now it work
Thanks for your excellent menu :D