我正在尝试使用jQuerytools 覆盖进行确认对话。我对调用叠加层的“onclick”函数有疑问。
HTML
<!-- list element -->
<ul>
<li id="item1">
<div class="listName">myListElement-1</div>
<div class="listCtrlr"><span onclick="delItem(1, 'myListElement-1')" rel="#deldlg">delete</span></div>
</li>
<li id="item2">
<div class="listName">myListElement-2</div>
<div class="listCtrlr"><span onclick="delItem(2, 'myListElement-2')" rel="#deldlg">delete</span></div>
</li>
<li id="item3">
<div class="listName">myListElement-3</div>
<div class="listCtrlr"><span onclick="delItem(3, 'myListElement-3')" rel="#deldlg">delete</span></div>
</li>
</ul>
<!-- overlay dialogue -->
<div id="deldlg" class="modd">
<h5>Confirmation - Delete Campaign</h5>
<div class="ctn">
<p id="dq">Are you sure you want to permanently delete this data?</p>
<p id="di"></p>
<input type="button" value="Yes" id="delsubmit" class="brButton s grdRed">
<input type="button" value="No" class="brButton s close">
</div>
</div>
JavaScript
function delItem(iid, iname) {
var trigger = this;
trigger.overlay({
fixed: false,
closeOnClick: false,
mask: {color:'#660000', loadSpeed:100, opacity:0.9},
onBeforeLoad:function() {
jQuery('#di').html(iname);
jQuery('#delsubmit').attr('onclick', 'del_camp('+iid+')');
}
});
}
当我使用上面的脚本时,它返回' trigger.overlay is not a function '。有人可以帮我解决这个问题吗?
我期望得到以下结果(假设我要删除 element-2)
Confirmation - Delete Campaign
-------------------------------------------------------------
Are you sure you want to permanently delete this data?
myListElement-2
[ Yes ] [ No ]