Hi.. (hope i place my question the right place)
Im trying to get a link one one page to activate/open a specifik accordian
but i cant get i to work
my accordion looks like this
- <div id="newsfolders">
- <h1><a href="#">NEWS 1</a><span class="newsdate">21/10/1969</span></h1>
- <div>
- <p>Curabitur massa mauris, feugiat ut consectetur eu ullamcorper eget quam.</p>
- <hr />
- </div>
- <h1><a href="#">NEWS 2</a><span class="newsdate">21/10/1969</span></h1>
- <div>
- <p>Curabitur massa mauris, feugiat ut consectetur eu ullamcorper eget quam.</p>
- <hr />
- </div>
- <h1><a href="#">NEWS 3</a><span class="newsdate">21/10/1969</span></h1>
- <div>
- <p>Curabitur massa mauris, feugiat ut consectetur eu ullamcorper eget quam.</p>
- <hr />
- </div>
- </div>
and my link like
- <a href="news.html#1" title="News">
i want the link to open the newspage with the coresponding div in the accordion oppen
This jQuery works
- $("#newsfolders").accordion({ autoHeight: false, collapsible: true });
- $("#newsfolders").accordion("option" , "activate", 1 );
but if i try to read the url and use the has value i wont work
- $("#newsfolders").accordion({ autoHeight: false, collapsible: true });
- var newsNum = window.location.hash.slice(1);
- $("#newsfolders").accordion("option" , "activate", newsNum );
alert(newsNum); do return the right number buth the accordion dont open..
How can i get this to work ??