一个类似于android Toast的信息提示框

1.引入bootstrap.css

<link rel="stylesheet" href="css/bootstrap.css"  type="text/css">

2.html

<div class="modal fade tipsAlertInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-body">
         </div>
      </div>
  </div>
</div>

 3.Javascript函数,根据传入的value提示相应的内容(一般用于提示后台数据库信息)

function tipsAlertInfo(info){
	$(".tipsAlertInfo .modal-body").html(info);
	$(".tipsAlertInfo").modal('show');
	setTimeout(function(){
		$(".tipsAlertInfo").modal('hide');
	},1000);
}

 

posted @ 2016-11-07 15:55  骑驴的是郭襄  阅读(578)  评论(0编辑  收藏  举报