Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>"I'd like users to be unable to click an already opened div."</p> </blockquote> <p><strong>This will work: <a href="http://jsfiddle.net/xixionia/9P6My/" rel="nofollow">http://jsfiddle.net/xixionia/9P6My/</a></strong></p> <pre><code>&lt;div&gt; &lt;h2 class="entry-title"&gt;Post Title 1&lt;/h2&gt; &lt;div class="entry-content"&gt;Lorem Ipsum Lorem Ipsum&lt;/div&gt; &lt;/div&gt; &lt;div&gt; &lt;h2 class="entry-title"&gt;Post Title 1&lt;/h2&gt; &lt;div class="entry-content"&gt;Lorem Ipsum Lorem Ipsum&lt;/div&gt; &lt;/div&gt; </code></pre> <p>and</p> <pre><code>$(".entry-title").click(function() { $(this) .next('.entry-content:not(:visible)') .slideToggle(500); }); </code></pre> <p>And the CSS:</p> <pre><code>.entry-content { display: none; } </code></pre> <p>Or, you can always skip the css and use hide() on all of your entry-content classed elements. :)</p> <p>This will toggle slide the first following element with the ".entry-content" class that are not visible, and will not slide them closed.</p> <p><strong>If you would like to actually unbind yourself from the click event entirely, you could use undbind('click')</strong></p> <pre><code>$(".entry-title").bind('click', function() { $(this) .unbind('click', arguments.callee) .next('.entry-content') .slideToggle(500); }); </code></pre> <p>This would be the most savvy approach, and will <em>not</em> unbind your other functions which may be bound to the click event.</p> <p>Or, you could unbind using event namespaces:</p> <pre><code>$(".entry-title").bind('click.slideopen', function() { // bind a click event with the slideopen namespace $(this) .unbind('.slideopen') // unbind all events in the slideopen namespace .next('.entry-content') .slideToggle(500); }); </code></pre> <p>You can see an example of this here: <a href="http://jsfiddle.net/xixionia/9P6My/6/" rel="nofollow">http://jsfiddle.net/xixionia/9P6My/6/</a></p>
    singulars
    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. VO
      singulars
      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