모두 .. 나는 검색했지만 아직 답변을 찾지 못했습니다. 어쩌면 여기서 나를 도울 수 있습니다 ...하나의 오버레이 요소에 여러 개의 트리거가있는 jQuerytools 오버레이
두 가지 (HTML) 목록이 있는데, "동물"과 "과일"이라고합시다. 각 목록에는 자식이 있고 자식 요소를 클릭하면 클릭 된 자식의 이름이있는 오버레이 요소가 표시됩니다. 지금까지 나는 "동물"목록에 대한 오버레이를 가질 수 있었지만 "과일"목록에 대해서는 아무 일도 일어나지 않았습니다. 여기
는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
});
});
경우 [내가 jQuerytools 1.2.7를 사용하고 있습니다]
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>
에게 .. 쉽게 이해할 수 있도록하기 위해 코드를입니다 동물 목록에서 "상어"를 클릭하면 오버레이가 작동합니다. 하지만 "오렌지"를 클릭하면 아무 일도 일어나지 않습니다. 누군가 제가 이걸 알아 내도록 도울 수 있습니까? 감사합니다.
답장을 보내 주셔서 감사합니다. odupont .. 귀하의 제안을 시도했지만 여전히 작동하지 않습니다. 다른 생각? * 어쨌든,'data- *'속성에 대해 감사드립니다. HTML5 기능이 아직 새로 도입되었습니다. * – psychonsky