PDA

View Full Version : Accordion Menu not collapsing



whateversclever
03-03-2008, 03:58 PM
1) Script Title: Accordion Menu Script

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

3) Describe problem: I posted before but the answer was of no help. I copy and pasted the script exactly as shown and it does not work. The menu in the example collapses whereas mine does not. Please compare the example on DD with what I get: http://www.parent-child.org/Wordpress/wp-content/themes/cutline-3-column-split-11/test.html

I feel as though I must be missing some bit of code that tells it to collapse and expand. Can you please tell me what that code is and where I put it?
Thanks

jscheuer1
03-03-2008, 04:16 PM
For one thing, the external script files are not on the server in the location where the page expects them to be:


<script type="text/javascript" src="jquery-1.2.2.pack.js"></script>

<script type="text/javascript" src="ddaccordion.js">

/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>

which, in its current location, is looking for them here:


http://www.parent-child.org/Wordpress/wp-content/themes/cutline-3-column-split-11/jquery-1.2.2.pack.js

and here:


http://www.parent-child.org/Wordpress/wp-content/themes/cutline-3-column-split-11/ddaccordion.js

respectively. There could also be other problems.

whateversclever
03-03-2008, 07:37 PM
Ok, I fixed that and it works on the html page I was testing it in. Thank you!

However, when I move it to use it as a sidebar for wordpress it goes back to the same problem:
http://www.parent-child.org/Wordpress/

How can I fix that?

jscheuer1
03-03-2008, 09:16 PM
It's the same problem. You could do with a little brush up on the basics of files and folders. If you are going to call upon these scripts from various locations throughout the site, why not just put them in a folder off the root:


http://www.parent-child.org/scripts/

Then, wherever you want to use them, use these as the calls on the page:


<script type="text/javascript" src="/scripts/jquery-1.2.2.pack.js"></script>

<script type="text/javascript" src="/scripts/ddaccordion.js">

/***********************************************
* Accordion Content script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
***********************************************/

</script>


Also, take a look at the source code of your page (in the browser, chose View > View Source). It has two opening head tags, and possibly other errors. These should be fixed because they might cause problems, if not now, later as your pages become more complex.

whateversclever
03-04-2008, 05:43 PM
Thank you! I can't believe I'm making such simple mistakes. Jumping back in to web design after several years. Thanks again!