Note that there are some explanatory texts on larger screens.

plurals
  1. POJquery selecting href with *=
    primarykey
    data
    text
    <p>My website has a main image that changes depending on what thumbnails you click on. For a certain main picture, I want text specific to that image to populate. The text starts out as display:none; and then I have it revealed with .show();. Nothing seems to be happening with my code, so any help would be much appreciated. The jquery is:</p> <pre><code>$(document).ready(function() { jQuery.fn.exists = function() { return this.length &gt; 0; }; if ($("div.bigimage a[href*='karina']").exists()) { $("ul li.karina").show(); $("ul li.natalia").hide(); $("ul li.celeste").hide(); } else if ($("div.bigimage a[href*='natalia']").exists()) { $("ul li.karina").hide(); $("ul li.natalia").show(); $("ul li.celeste").hide(); } else if ($("div.bigimage a[href*='celeste']").exists()) { $("ul li.karina").hide(); $("ul li.natalia").hide(); $("ul li.celeste").show(); } else { $("ul li.karina").hide(); $("ul li.natalia").hide(); $("ul li.celeste").hide(); } </code></pre> <p>});​</p> <p>the html it is trying to select is:</p> <pre><code>​&lt;div class="bigimage"&gt; &lt;li&gt; &lt;a href="http://cdn.shopify.com/s/files/1/0103/5102/products/Natalia_1024x1024_IMG_5760.jpg?4679"&gt;picture here&lt;/a&gt;&lt;/li&gt; &lt;/div&gt; &lt;ul&gt; &lt;li id="model-name" class="karina"&gt;Karina is 5'7" and is wearing a size 34 C/D Regular&lt;/li&gt; &lt;li id="model-name" class="celeste"&gt;Celeste is 5'8" and is wearing a size 34 C/D Regular&lt;/li&gt; &lt;li id="model-name" class="natalia"&gt;Natalia is 5'10" and is wearing a size 34 A/B Tall&lt;/li&gt; &lt;/ul&gt;​​​​​​ </code></pre>
    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.
 

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