Note that there are some explanatory texts on larger screens.

plurals
  1. POMake this including a unique data
    primarykey
    data
    text
    <p>As I will have multiple places where this is, I would like to get it to work with a unique data.</p> <p>Like instead of <code>&lt;a class="snippet_show_answers" href="#"&gt;Se svar&lt;/a&gt;</code> then maybe something like <code>&lt;a DATA="1" class="snippet_show_answers" href="#"&gt;Se svar&lt;/a&gt;</code>, which then should run as a part of my script, so that it only handle for the clicked DATA, and not for all of the boxes.</p> <p>My HTML is this (With multiple of those):</p> <pre><code>&lt;p class="snippet_answers"&gt;Svar: 3 - &lt;span class="green"&gt;&lt;a class="snippet_show_answers" href="#"&gt;Se svar&lt;img src="images/answerarrow.png" alt="answerarrow" height="14" width="13"&gt;&lt;/a&gt;&lt;a class="snippet_hide_answers" href="#" style="display: none;"&gt;Skjul svar&lt;img src="images/answerarrow.png" alt="answerarrow" height="14" width="13"&gt;&lt;/a&gt;&lt;/span&gt;&lt;hr /&gt; &lt;div class="answers" style="display: none;"&gt; &lt;p&gt;blablabla&lt;/p&gt; &lt;/div&gt; &lt;/p&gt; </code></pre> <p>My JS is this:</p> <pre><code>$('.snippet_show_answers').live("click", function() { $('.answers').slideDown("slow"); $('.snippet_show_answers').fadeOut("slow"); $('.snippet_hide_answers').fadeIn("slow"); return false; }); $('.snippet_hide_answers').live("click", function() { $('.answers').slideUp("slow"); $('.snippet_hide_answers').fadeOut("slow"); $('.snippet_show_answers').fadeIn("slow"); return false; }); </code></pre> <p>Hope someone understand me, cause I have seen this method before, but I dont know the name of it, or anything.</p> <p>Thanks in advanced.</p>
    singulars
    1. This table or related slice is empty.
    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