PDA

View Full Version : Accordion Content script - Set Default Expand Inline?



mmc215
08-07-2008, 08:01 PM
1) Script Title: Accordion Content script

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

3) Describe problem: Hey guys, I have a simple question for anyone that is familiar with how this awesome script works..

I am using this menu as a sub-menu for pages within a technical document. I'd like to set the defualt expanded List Item for each page individually based on an inline calls since the template I am using doesn't allow me to edit the universal "defaultexpanded" configuration script in the html header.

Anyone know how I can get this done?

ddadmin
08-08-2008, 04:38 AM
You can try calling ddaccordion.expandone() (http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm) to specifically expand a header. In your case, since you want to do this automatically when the page loads, you should wrap it inside jQuery's DOM onload function:


<script type="text/javascript">

jQuery(document).ready(function($){
ddaccordion.expandone('expandable', 2) //expand 3rd header of Header Class "expandable"
})

</script>

mmc215
08-12-2008, 09:08 PM
Thanks! this works!