0
我无法将包含input
按钮的Popup窗体附加Click Click事件。下面的代码给出:如何使用弹出式花式框上的按钮附加Click事件>
<a id="btnEditSummary" href=#>Edit Summary </a>
<div id="editSummary" class="hidden">
<input type=button id="btnEdit" value="Update" />
</div>
function openPoPup(clickHandle,contentHandle,width,height)
{
width = typeof a !== 'undefined' ? a : 600;
height = typeof b !== 'undefined' ? b : 300;
$.fancybox(
$(contentHandle).html(),
{
'width' : width,
'height' : height,
'minWidth' : width,
'minHeight' : height,
'autoScale' : true,
'transitionIn' : 'none',
'transitionOut' : 'none',
'hideOnContentClick': false,
'onStart': function() {
//On Start callback if needed
}
}
);
}
$("#btnEditSummary").click(function()
{
openPoPup('#btnEditSummary','#editSummary',300,300);
$("#btnEdit").on("click", function() {
alert($(this).text());
});
}
$("#btnEdit").on("click", function() {
alert($(this).text());
});
它确实工作,但旧版本。我正在使用Fancybox v2.x – Volatil3 2014-10-21 05:50:07
@ Volatil3,然后使用适当的API选项和回调:'afterShow'而不是'onComplete',例如'.fancybox-inner'而不是'#fancybox-content' – JFK 2014-10-21 06:46:58