Note that there are some explanatory texts on larger screens.

plurals
  1. POMake a link do 2 actions
    primarykey
    data
    text
    <p>Before anything, I don't know if I'm taking the right approach to this so bear with me on this.</p> <p>My problem is as follows: I'm trying to use an accordion where each tab is a category and when expanded, the accordion shows the artists in that category. So far, so good.</p> <p>Now, the other part of what I'm trying to achieve is this: Once I click on the tab (which has a "#" link) I need to display the artists list in a div, which I was planning to do with AJAX. I can do this without problems if the link was INSIDE the accordion contents (for example, if I wanted to click on an artist) but can't figure out how to make it work when clicking a tab.</p> <p>My code is as follows: </p> <pre><code>&lt;li class="artistlist"&gt; &lt;a href="#"&gt;Photo&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="artist.html"&gt;Artist&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="artist.html"&gt;Artist&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="artist.html"&gt;Artist&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div id="contentbox"&gt; &lt;div id="artistcat"&gt; &lt;/div&gt; &lt;/div&gt;&lt;!-- /contentbox --&gt; </code></pre> <p>and what I'm trying to do is the following: replace href=# with something like this: <code>&lt;a href="javascript:ajaxpage('ajaxed/abstrakt.html', 'contentbox');"&gt;Abstrakt&lt;/a&gt;</code></p> <p>thus, when clicking on a category (for example "photo") it expands the accordion (which it does) AND shows the content in the ajax box, which is exactly the same content of the accordion only with thumbnails.</p> <p>So basically, I need to make that tab link do 2 actions: 1) expand the accordion and 2) show the ajax content.</p> <p>I'm thinking that perhaps the AJAX solution is the wrong way, either way, any help will be greatly appreciated.</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. 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