php实战第九天

文献:http://www.verydemo.com/demo_c116_i62046.html

以下代码不能单独运行的。需要 bootstrap和jquery
/**
* 用于显示对话框消息框
* 参数 title 消息标题
* 参数 content 消息内容
* 参数 buttomTitle 处理消息的按钮自定义的,比如确认删除
* 参数 fun 自定义按钮click事件
* 参数 passOnData 传递到自定义fun里的参数
*/
function show_Msg (title,content,buttomTitle,fun,passOnData) {
	$("#msg #myModalLabel").html(title);
	$("#msg .modal-body").html(content);
	$('#msg #msg_c').html(buttomTitle).click(function(){
		fun(passOnData);//调用自定义的函数,以及传递自定义的数据
		$('#msg').modal('hide');//点击完就把窗口隐藏了
		$(this).unbind('click');//如果不取消事件,那么将重复调用。。
	});;
	$('#msg').modal('show');
}
html消息框模板
<!-- 消息框模板 -->
<div id="msg" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel"></h3>
  </div>
  <div class="modal-body">

  </div>
  <div class="modal-footer">
    <button class="btn" data-dismiss="modal" aria-hidden="true">取消</button>
    <button id="msg_c" class="btn btn-primary"></button>…………………………………………………………………………
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值