Note that there are some explanatory texts on larger screens.

plurals
  1. POSimple Accordion syntax
    text
    copied!<p>I am trying to figure why the nav links wont open the accordion. I am sure there is just some jquery that is not in proper syntax. I changed the selectors in the jquery code and now it wont work. </p> <p>Im sure to a trained eye this should be a quick fix.</p> <p>Can anyone help? </p> <p><pre><code></p> //////////////////////////// // http://www.adipalaz.com/experiments/jquery/accordion.html /////////////////////////// (function($) { //http://www.mail-archive.com/jquery-en@googlegroups.com/msg43851.html $.fn.orphans = function(){ var txt = []; this.each(function(){$.each(this.childNodes, function() { if (this.nodeType == 3 && $.trim(this.nodeValue)) txt.push(this) })}); return $(txt); }; //http://www.learningjquery.com/2008/02/simple-effects-plugins: $.fn.fadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle'}, speed, easing, callback); }; $.fn.slideFadeToggle = function(speed, easing, callback) { return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); }; })(jQuery); //////////////////////////// $(function() { $('.collapse').hide(); $('.expand').orphans().wrap(''); //demo 4 - div.demo:eq(3) - queued slide effects: $('div.demo .expand').click(function() { var $thisCllps = $(this).next('.collapse'); var $cllpsVisible = $(this).ul('.expand').next('.collapse:visible'); ($cllpsVisible.length) ? $(this).toggleClass('open').siblings('.expand').removeClass('open') .next('.collapse:visible').slideUp(400, function() { $thisCllps.slideDown(); }) : $thisCllps.slideToggle().prev('.expand').toggleClass('open'); return false; }); }); <p></pre></code></p> <p><pre><code></p> <pre><code> &lt;div class="demo"&gt; &lt;ul class="collapse" class="ul" style="display: none; "&gt; &lt;li&gt;Item 1.1.&lt;/li&gt; &lt;li&gt;Item 1.2.&lt;/li&gt; &lt;/ul&gt; &lt;ul class="collapse" class="ul" style="display: none; "&gt; &lt;li&gt;Item 2.1.&lt;/li&gt; &lt;li&gt;Item 2.2.&lt;/li&gt; &lt;/ul&gt; &lt;ul class="collapse" class="ul" style="display: none; "&gt; &lt;li&gt;Item 3.1.&lt;/li&gt; &lt;li&gt;Item 3.2.&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;ul&gt; &lt;li&gt; &lt;h4 class="expand"&gt;&lt;a href="#" title="expand/collapse"&gt;Slide Up/Down UL 1&lt;/a&gt;&lt;/h4&gt; &lt;/li&gt; &lt;li&gt; &lt;h4 class="expand"&gt;&lt;a href="#" title="expand/collapse"&gt;Slide Up/Down UL 2&lt;/a&gt;&lt;/h4&gt; &lt;/li&gt; &lt;li&gt; &lt;h4 class="expand"&gt;&lt;a href="#" title="expand/collapse"&gt;Slide Up/Down UL 3&lt;/a&gt;&lt;/h4&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p></pre></code></p>
 

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