我正面臨一個奇怪的問題。檢查複選框時,我確實需要顯示一個彈出窗口。它工作正常,但即使在取消選中時也會出現相同的彈出窗口。jQuery colorbox - 即使在關閉後也會調用
<af:objectImage id="agreementCheckBoxImg" source="/base/images/spacer.gif" styleClass="jqTransformCheckbox" onclick="displayPopup(this.id,'main\\\\:content\\\\:Popupregion\\\\:Popup','520px','260px');return false;"/>
<script type="text/javascript">
function displayPopup(buttonId,popId,width,height) {
var eminputSelf = $("#main\\:content\\:check");
if (eminputSelf.attr("checked") == true) { // check box condition works fine
alert('returning do not show popup');
} else {
$('#'+needHelpId).colorbox({ open:true, title:'',innerWidth:interWidth, innerHeight:innerHeight,close:'shutdown', inline:true, href:popId , onOpen:function(){ $(popId).show();}, onCleanup:function(){ $(popId).hide();}});
}
}
</script>
在取消選中期間警報即將到來,但彈出窗口也會到來。
請幫忙。提前致謝。
代碼的其餘部分在哪裏?複選框事件偵聽器?什麼叫上面的「if/else」?如果有人想爲你製作演示版,HTML也可能會有所幫助。 – Sparky