Link to Website with open accordion

55 views Asked by At

I know that this has been asked before but I could not get it to work: take this website: http://www.rrpowersystems.com/karriere/stellenangebote/index.de.html

when I click on the first panel thing with the text ("Abschlussarbeit "Planung, Konstruktion (...)" it opens a more detailed text.

Now I would like to send this link to a friend with this panel already opened. With the inspect page tool i see that it is in the the number that I guess is essential but I just can't construct the link that I can sent somebody.

Thanks so much!

2

There are 2 answers

1
Zachary Kniebel On

To answer your question directly, the jQuery UI Accordion widget does not ship with native support for auto-opening an accordion based on a hash or querystring value that is passed in the URL. Sites that have such functionality implemented are using custom logic to make that happen.

The site you linked to does not actually use jQuery UI nor its Accordion widget. I searched the source code for the text that you mentioned, and found that it is one of the options in the SelectBox (a plugin that they are using). Unfortunately, there is also no native support for auto-selecting values based on a hash or querystring value passed in the URL.

2
Hien Luong On

You can add the query, ex: #triggerbtn, into the link, so it would be like this: http://www.rrpowersystems.com/karriere/stellenangebote/index.de.html#triggerbtn

 <body onload="triggerMe()"></body>
 <script>
    function triggerMe() {
       var check = location.hash;
       if (check == "triggerbtn") {
           //button trigger even though you do not click on it
           $('.navimain_1').trigger('click');    
       }
    }
 </script>