Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I figured it out by myself, as shown below. Suppose this is your jquery UI according consisting of four accordians.</p> <pre><code> &lt;div id="accordion" class="accordion"&gt; &lt;div&gt; &lt;h3&gt;&lt;a href="#"&gt;First&lt;/a&gt;&lt;/h3&gt; &lt;div&gt;Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.&lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;&lt;a href="#"&gt;Second&lt;/a&gt;&lt;/h3&gt; &lt;div&gt;Phasellus mattis tincidunt nibh.&lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;&lt;a href="#"&gt;Third&lt;/a&gt;&lt;/h3&gt; &lt;div&gt;Nam dui erat, auctor a, dignissim quis.&lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h3&gt;&lt;a href="#"&gt;Fourth&lt;/a&gt;&lt;/h3&gt; &lt;div&gt;Nam dui erat, auctor a, dignissim quis.&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>Now add external anchors with their different ID's </p> <pre><code> &lt;!-- Enternal Anchor Mossawir --&gt; &lt;div&gt; &lt;a href="#" id="openfirst"&gt;Open 1st&lt;/a&gt; &lt;a href="#" id="opensecond"&gt;Open 2nd&lt;/a&gt; &lt;a href="#" id="openthird"&gt;Open 3rd&lt;/a&gt; &lt;a href="#" id="openfourth"&gt;Open 4th&lt;/a&gt; &lt;/div&gt; </code></pre> <p>Now add jquery code. </p> <pre><code> $(function(){ $("#accordion").accordion({ header: "h3" }); //this will open 1st accordian. $('#openfirst').click(function(){ $(".accordion").accordion({active:0}); }); //this will open 2nd accordian. $('#opensecond').click(function(){ $(".accordion").accordion({active:1}); }); //this will open 3rd accordian. $('#openthird').click(function(){ $(".accordion").accordion({active:2}); }); //this will open 4th accordian. $('#openfourth').click(function(){ $(".accordion").accordion({active:3}); }); }); </code></pre> <p>To add more accordions and anchor, simply add an new id to anchor and in jquery code will give its active parameter. active:0 means 1st accordion, active:1 means the second accordian and so on. this works for Jquery UI accordion. Here is an example: <a href="http://jsfiddle.net/ZRBc6/1/" rel="nofollow">http://jsfiddle.net/ZRBc6/1/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload