Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try using <code>visibility</code> instead. Example:</p> <pre><code>$("#id2").click(function (e) { $("#id1").css('visibility','hidden'); $("#id3").css('visibility','hidden'); $("#id2").css('visibility','visible'); }); </code></pre> <p>Both <code>display</code> and <code>visibility</code> can have an effect on browser behavior.</p> <p>An alternative work-around to both is to set the <code>opacity</code> of the divs you want to hide to <code>0</code>. That always works in my experience but is less elegant.</p> <hr> <p><strong>Update in reply to comment:</strong> In that case, you can set other properties like the <code>width</code> and <code>height</code> to <code>0px</code> and the <code>over-flow</code> to <code>hidden</code> so that the divs don't occupy any space on screen. Ugly, but basic, and works.</p> <pre><code>&lt;style&gt; .hidden { visibility: hidden; overflow: hidden; width: 0px; height: 0px; } &lt;/style&gt; &lt;div class="hidden"&gt;&lt;img src="http://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/Aster_Tataricus.JPG/245px-Aster_Tataricus.JPG"/&gt;&lt;/div&gt; &lt;div class="hidden"&gt;&lt;img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Chamomile%40original_size.jpg/280px-Chamomile%40original_size.jpg"/&gt;&lt;/div&gt; &lt;div&gt;&lt;img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a7/Jonquil_flowers06.jpg/320px-Jonquil_flowers06.jpg"/&gt;&lt;/div&gt; </code></pre> <p>You can use the jQuery <code>addClass</code> and <code>removeClass</code> methods to make the divs visible and invisible, e.g.: <code>$("#id1").removeClass("hidden");</code> and <code>$("#id3").addClass("hidden");</code>.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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