Show a Facebox from a button click event

旧时模样 提交于 2019-12-25 00:08:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!