Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed my jQuery tabs not to close when active and already open
    text
    copied!<p>I am using this jQuery script to hide and reveal 4 div containers with HTML content on the page.</p> <p>jQuery:</p> <pre><code>$('.content-drawer').hide(); $('#tab1').show(); $('#calc').show(); $('.tab').click(function() { var $this = $(this); var target = $(this.rel); $this.closest('li').addClass('active focus'); // Add the classes to the closest li of the clicked anchor $('.tab').not($this).closest('li').removeClass('active focus'); // Remove the classes for the non-clicked items $('.content-drawer').not(target).fadeOut(); // Slideup the other contents target.delay(400).fadeToggle(); // Toggle the css3-mediaqueriesrrent content if (target.is(':visible')) { // Only if the target is visible remove the active class $this.closest('li').removeClass('active'); } return false; }); </code></pre> <p>HTML:</p> <pre><code>&lt;div class="content-drawer" id="tab2"&gt; &lt;div class="sixcol"&gt; &lt;img src="css/img/books.png" alt=""&gt; &lt;/div&gt; &lt;div class="sixcol last"&gt; &lt;article&gt; &lt;h2&gt;From our family to yours&lt;/h2&gt; &lt;p&gt;Sed posuere consectetur est at lobortis. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Nullam quis risus eget urna mollis ornare vel eu leo. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem.&lt;/p&gt; &lt;a class="button fancy" href="#"&gt;Learn More&lt;/a&gt; &lt;/article&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The client takes issue with it on account of the fact that when you click the div that is currently open, it closes leaving nothing on the screen.</p> <p>What I Need: for the open div to not be "closable" on click</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