View Full Version : Jump to anchor inside Accordion header ?

07-08-2009, 09:52 AM
1) Script Title: Accordion Content

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

3) Describe problem:


In a html file, I have a huge list of anchor. I works well : jump to an anchor from another page.
Then I added accordion script to split and organize the list in several parts.

I used this suggestion :

<a href="target.htm?accordionheaderclass=2#myanchor">Target Page</a>
in the thread http://www.dynamicdrive.com/forums/showthread.php?t=40366

But it the link with header and an anchor does not work : it does not jump to the anchor in the expanded header.

Anyone succedeed ?


07-08-2009, 10:41 PM
Do you have a link to the problem page?

07-09-2009, 02:02 PM
Here is a test code : http://pastebin.com/m171f7717

Here is initjq.js content (I deleted useless code except for accordion in fact) :

headerclass: "collapsehead", contentclass: "collapse",
collapseprev: false, defaultexpanded: lExp,
animatedefault: false, persiststate: false,
toggleclass: ["", ""],
togglehtml: ["prefix", "<img src=\'/lib/plus.gif\' alt=\'plus\' />&nbsp;", "<img src=\'/lib/minus.gif\' alt=\'moins\' />&nbsp;"],
animatespeed: "fast",
oninit:function(expandedindices){ //do nothing
onopenclose:function(header, index, state, isclicked){ // do nothing

The html page can be reached by this :

<a href="testanchor.html?collapsehead=1#TEST170">TEST170</a>

I updated jquery to last version.

It works simply by deleting the line with initjq.js...


07-09-2009, 11:00 PM
Hmm do you have a link to an actual working page? The above merely shows the HTML source, but I need to be able to run the page to see the problem.

07-10-2009, 06:24 AM
No I can't as it is an intranet at work...