Hi!

The best is to look at the link i posted. You can see i have several DIV's 
with class "accordion-group" and an unique id name "event<Date of the 
event>"
So when the programm.html is loaded, the jquery.ready function comes to 
action and parses the URL. If the URL has a hash, it takes it and tries to 
ge the href of the elemet "event<Date of the event> .accordion-toggle", so 
that it can call the "collapse('show')" on it.

HTH
regards,
Gerd

Am Donnerstag, 12. April 2012 22:13:32 UTC+2 schrieb [email protected]:
>
> I'm not quite sure how to get this working. I pasted the js into my 
> applications.js so the script is in every footer and linked to 
> the accordion page with location hashes. Do I somehow need to edit the 
> script below?
>
> On Sunday, 1 April 2012 09:40:51 UTC+1, Gerd Niemetz wrote:
>>
>> Hi!
>>
>> I did it with location hash. For example:
>> On my index.html i have a link to programm.html set with "
>> http://www.kuba-eferding.at/programm.html#event20120410";
>>
>> In the programm.html i check it like this
>>
>>     if (window.location.hash) {      var EventID = window.location.hash;     
>>  AccordionBodyID = $(EventID + ' .accordion-toggle').attr('href');      if 
>> (! (typeof AccordionBodyID === "undefined")) {        
>> $(AccordionBodyID).collapse('show');        return true;      }    }
>>
>> HTH
>> regards,
>> Gerd
>>
>> Am Samstag, 31. März 2012 14:42:55 UTC+2 schrieb [email protected]:
>>>
>>> Hi 
>>>
>>> How do I open an accordion panel by linking to an anchor within it 
>>> from another page? The accordion is normally closed. 
>>>
>>> Stumped. 
>>>
>>> Dan
>>
>>

Reply via email to