everyone.. I've searched around but haven't found the answer yet. maybe you can help me here...
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.
here's the code to make it easier to understand..
HTML
<ul id="animalList">
<li id="1" rel="#aniover">tiger</li>
<li id="2" rel="#aniover">shark</li>
<li id="3" rel="#aniover">eagle</li>
</ul>
<ul id="fruitList">
<li id="1" rel="#fruover">mango</li>
<li id="2" rel="#fruover">orange</li>
<li id="3" rel="#fruover">banana</li>
</ul>
<div class="modal" id="aniover">
<h3>Animal Selected!</h3>
<span id="anisel"></span>
</div>
<div class="modal" id="fruover">
<h3>Fruit Selected!</h3>
<span id="frusel"></span>
</div>
Javascript [I'm using jQuerytools 1.2.7]
jQuery('ul#animalList > li').click(function(){
anname = jQuery(this).html();
anid = jQuery(this).attr('id');
antext = '['+anid+'] '+anname;
jQuery('ul#animalList > li[rel]').overlay({
mask:{color:'#666666',loadSpeed:100,opacity:0.8},
onBeforeLoad:function(){jQuery('#anisel').html(antext);},
oneInstance:false
});
});
jQuery('ul#fruitList > li').click(function(){
funame = jQuery(this).html();
fuid = jQuery(this).attr('id');
futext = '['+fuid+'] '+funame;
jQuery('ul#fruitList > li[rel]').overlay({
mask:{color:'#666666',loadSpeed:100,opacity:0.8},
onBeforeLoad:function(){jQuery('#frusel').html(futext);},
oneInstance:false
});
});
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