问题
The examples I have seen all show a Facebox by clicking on an anchor. Is it possible to use a button instead? I am modifying an asp.net page that dynamically generates asp:button controls, and would like to not have to replace them with anchors. Thanks.
回答1:
I was able to achieve this
jquery:
$('#save').click(function(){
$.facebox($('#save_name').html());
});
html:
<input id='save' type='button' class="facebox" value='Save Report' />
<div id="save_name" style="display:none" >
<label>Report Name: </label>
<input name="report_name" type="text" />
<input id="save_report" type="button" value="Save" />
</div>
来源:https://stackoverflow.com/questions/2466810/show-a-facebox-from-a-button-click-event