Note that there are some explanatory texts on larger screens.

plurals
  1. POShow / hide more than one div:s
    primarykey
    data
    text
    <p>I have two div: s that I want to be able to show and hide. Today I can show and hide the ones we click on their respective links.</p> <p>The downside today is that all div opened simultaneously. I want each div is opened by clicking on the respective link. But I do not get to it with my script, does anyone have any idea? '</p> <pre><code>&lt;ul&gt; &lt;li class="toogle"&gt;&lt;a href="#" class="show_hide" id="plus"&gt;Se fler konstnärer +&lt;/a&gt;&lt;/li&gt; &lt;div class="slidingDiv" style="display: block;"&gt; &lt;li&gt;&lt;a href="#"&gt;Edvard Munch&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Ardy Strüwer&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Ari Behn&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Astrid Gate&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Cecilie Moi Sindum&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Vebjørn Sand&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Per Winge&lt;/a&gt;&lt;/li&gt; &lt;/div&gt; &lt;/ul&gt; &lt;ul&gt; &lt;li class="toogle"&gt;&lt;a href="#" class="show_hide" id="plus"&gt;Se fler konstnärer +&lt;/a&gt;&lt;/li&gt; &lt;div class="slidingDiv" style="display: block;"&gt; &lt;li&gt;&lt;a href="#"&gt;Teresa Bergerud&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Per Spook&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Cathrine Maske&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Gro Eriksson&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Johan Verde&lt;/a&gt;&lt;/li&gt; &lt;/div&gt; &lt;/ul&gt; $(document).ready(function(){ $(".slidingDiv").hide(); $(".show_hide").show(); $('.show_hide').toggle(function(){ $(".slidingDiv").slideDown( function(){ $("#plus").text("Se färre konstnärer -") } ); },function(){ $(".slidingDiv").slideUp( function(){ $("#plus").text("Se fler konstnärer +") } ); }); }); </code></pre>
    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.
    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