在我的示例中,我尝试将$('#integrate_employee_popup').modal('show');
与$("#integrate_employee_popup").bind('show',function(e) {});
绑定。它曾经是一个块UI,现在是升级时间来引导JQuery以提高响应速度。
旧命令是$('#integrate_employee_popup').trigger('block')
和$("#integrate_employee_popup").bind('block',function(e) {});
。我必须在这里错过一些元素来插入它。
$(".integrate_employee_link").click(function(e) {
button_id = this.id;
employee_question_id = this.id.split('_')[2];
integrate_employee_target = ($(this).attr('target')===undefined)?'':$(this).attr('target');
integrate_employee_onunblock = ($(this).attr('onunblock')===undefined)?'':$(this).attr('onunblock');
integrate_employee_jsonID = ($(this).attr('jsonID')===undefined)?'jsonID':$(this).attr('jsonID');
integrate_employee_columns = ($(this).attr('columns')===undefined)?'fname=First Name, lname=Last Name':$(this).attr('columns');
integrate_employee_select = ($(this).attr('tooltype')===undefined)?'radio':$(this).attr('tooltype');
integrate_employee_employeetype = ($(this).attr('employeetype')===undefined)?'basic':$(this).attr('employeetype');
integrate_employee_searchresultlabel = ($(this).attr('searchresultlabel')===undefined)?'Existing Active Employees':$(this).attr('searchresultlabel');
integrate_employee_selectmod = ($(this).attr('selectmod')===undefined)?'':$(this).attr('selectmod');
integrate_employee_frommod = ($(this).attr('frommod')===undefined)?'':$(this).attr('frommod');
integrate_employee_wheremod = ($(this).attr('wheremod')===undefined)?'':$(this).attr('wheremod');
integrate_employee_secondquery = ($(this).attr('secondquery')===undefined)?'':$(this).attr('secondquery');
integrate_employee_tool =($(this).attr('tool')===undefined)?'':$(this).attr('tool');
integrate_jobtitleID = $('#integrate_employee_form #employee_form_jobtitleID').val();
integrate_categoryID = $('#integrate_employee_form #employee_form_categoryID').val();
integrate_shiftID = $('#integrate_employee_form #shiftID').val();
$('#integrate_employee_popup').modal('show');
return false;
});
$("#integrate_employee_popup").bind('show',function(e) {
$('#target').val(integrate_employee_target);
$('#jsonID').val(integrate_employee_jsonID);
$('#employeesearchlabel').html(integrate_employee_searchresultlabel);
$('#integrate_employee_desc').val('');
integrate_employee_searchresults();
});
答案 0 :(得分:0)
对于Bootstrap
文档,您应该使用show.bs.modal
事件,check this list
因此,假设身份integrate_employee_popup
的元素已经是Bootstrap
模式,您可以这样做:
$("#integrate_employee_popup").bind('show.bs.modal',function(e) {
//your code goes here
}
此外,如果我的想法没有让我失望,return false
中的jQuery click
可能会停止事件传播。