View Full Version : Help Implementing this script

07-06-2009, 09:27 PM
1) Script Title: Adding arbitrary links on page that expand/ collapse the contents

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordion_suppliment.htm?mypets=0

3) Describe problem: Unclear how to install script.

I want to use this on my web page. I can't find a place where I can copy paste the code to edit it to my own needs. I tried to implement it on my page but I think I'm missing a .js file which I don't know how to get. I'm good with HTML and CSS but not so much with java. I would appreciate any help!

07-07-2009, 02:50 AM
There isn't much to implement actually beyond just having the script installed on your page and working (http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm). If it is, adding arbitrary links to expand/contract contents merely involves creating a link like:

<a href="#" onClick="ddaccordion.expandone('mypets', 0); return false">Expand 1st header</a>

Where "mypets' is the shared CSS class name of the header group you wish to expand, and 0 means expanding the first header (1=2nd header etc).