Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery accordion issues/tips
    primarykey
    data
    text
    <p>I've got a jQuery accordion (not using the actual .accordion function mind you - as this is a bit more complex) that isn't operating properly. Basically when you have click on one menu and it opens, then click on another, the previous menu should close - but mine doesn't and I can't figure out why.</p> <p>Can someone check my code to see what I'm missing?</p> <p>Also, since I have your attention, is there a way for me to set up the jQuery so that the bottom menu option (in this case the contact section) slides down revealing the content <em>above</em> it, instead of below it?</p> <p>HTML</p> <pre><code> &lt;div id="container"&gt; &lt;div class="menu"&gt; &lt;section id="about-me"&gt; &lt;a href="#" id="about" class="nav"&gt;about&lt;/a&gt; &lt;div class="menu-stuffing"&gt; (info) &lt;/div&gt; &lt;/section&gt; &lt;section id="my-work"&gt; &lt;a href="#" id="portfolio" class="nav"&gt;work&lt;/a&gt; &lt;/section&gt; &lt;section id="my-blog"&gt; &lt;a href="" id="blog" class="nav"&gt;blog&lt;/a&gt; &lt;/section&gt; &lt;section id="contact-form"&gt; &lt;a href="#" id="kit" class="nav"&gt;contact&lt;/a&gt; &lt;div class="menu-stuffing" id="contact-form"&gt; (info) &lt;/div&gt; &lt;/section&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>jQuery</p> <pre><code> $("div.menu-stuffing").hide(); $('div.menu &gt; section &gt; a &gt; div').hide(); $('div.menu &gt; section &gt; a').click(function() { event.preventDefault(); $(this).next('div').slideToggle('fast') .siblings('div:visible').slideUp('fast'); }); }); </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