Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuerytools overlay with multiple trigger to one overlay element
    primarykey
    data
    text
    <p>everyone.. I've searched around but haven't found the answer yet. maybe you can help me here...</p> <p>I have two (HTML) lists, let's call it "animal" and "fruits". each list has some child, and when I click a child element, it will show the overlay element with the name of clicked child. so far I'm able to have overlay for the "animal" list, but for the "fruits" list nothing is happened.</p> <p>here's the code to make it easier to understand..</p> <p><strong>HTML</strong></p> <pre><code>&lt;ul id="animalList"&gt; &lt;li id="1" rel="#aniover"&gt;tiger&lt;/li&gt; &lt;li id="2" rel="#aniover"&gt;shark&lt;/li&gt; &lt;li id="3" rel="#aniover"&gt;eagle&lt;/li&gt; &lt;/ul&gt; &lt;ul id="fruitList"&gt; &lt;li id="1" rel="#fruover"&gt;mango&lt;/li&gt; &lt;li id="2" rel="#fruover"&gt;orange&lt;/li&gt; &lt;li id="3" rel="#fruover"&gt;banana&lt;/li&gt; &lt;/ul&gt; &lt;div class="modal" id="aniover"&gt; &lt;h3&gt;Animal Selected!&lt;/h3&gt; &lt;span id="anisel"&gt;&lt;/span&gt; &lt;/div&gt; &lt;div class="modal" id="fruover"&gt; &lt;h3&gt;Fruit Selected!&lt;/h3&gt; &lt;span id="frusel"&gt;&lt;/span&gt; &lt;/div&gt; </code></pre> <p><strong>Javascript</strong> [I'm using jQuerytools 1.2.7]</p> <pre><code>jQuery('ul#animalList &gt; li').click(function(){ anname = jQuery(this).html(); anid = jQuery(this).attr('id'); antext = '['+anid+'] '+anname; jQuery('ul#animalList &gt; li[rel]').overlay({ mask:{color:'#666666',loadSpeed:100,opacity:0.8}, onBeforeLoad:function(){jQuery('#anisel').html(antext);}, oneInstance:false }); }); jQuery('ul#fruitList &gt; li').click(function(){ funame = jQuery(this).html(); fuid = jQuery(this).attr('id'); futext = '['+fuid+'] '+funame; jQuery('ul#fruitList &gt; li[rel]').overlay({ mask:{color:'#666666',loadSpeed:100,opacity:0.8}, onBeforeLoad:function(){jQuery('#frusel').html(futext);}, oneInstance:false }); }); </code></pre> <p>if I click "shark" from the animal list, the overlay works. but when I click "orange", nothing's happened. can somebody help me to figure this out? thanks</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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