<!DOCTYPE html>

<html>
<head>
<meta name="viewport" content="width=device-width" />
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
<title>Index</title>
</head>
<body>
<input type="button" name="name" value="新增" id="btn_add" />
<input type="button" name="name" value="编辑" id="btn_edit" />
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">新增</h4>
</div>
<div class="modal-body"> <div class="form-group">
<label for="txt_departmentname">年龄</label>
<input type="text" name="txt_departmentname" class="form-control" id="txt_departmentname" placeholder="年龄">
</div>
<div class="form-group">
<label for="txt_parentdepartment">姓名</label>
<input type="text" name="txt_parentdepartment" class="form-control" id="txt_parentdepartment" placeholder="姓名">
</div>
<div class="form-group">
<label for="txt_departmentlevel">性别</label>
<input type="text" name="txt_departmentlevel" class="form-control" id="txt_departmentlevel" placeholder="性别">
</div>
<div class="form-group">
<label for="txt_statu">自我描述</label>
<input type="text" name="txt_statu" class="form-control" id="txt_statu" placeholder="一句话描述">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span>关闭</button>
<button type="button" id="btn_submit" class="btn btn-primary" data-dismiss="modal"><span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>保存</button>
</div>
</div>
</div>
</div>
<script> //注册新增按钮的事件
$("#btn_add").click(function () {
$("#myModalLabel").text("新增");
$('#myModal').modal();
}); //注册编辑按钮的事件
$("#btn_edit").click(function () {
$("#myModalLabel").text("编辑");
$('#myModal').modal();
}); </script>
</body>
</html>

效果图:

案例二:

 <button class="btn btn-warning" data-toggle="modal" id="btn_addjcxxwh"><i class="glyphicon glyphicon-plus"></i> 添加</button>

<div class="modal fade" id="jcxxwhModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title" id="jcxxModalLabel">
新增
</h4>
</div>
<form class="form-horizontal" role="form">
<div class="modal-body"> <div class="form-group">
<label for="item_name" class="col-sm-3 control-label">项目名称</label>
<div class="col-sm-9">
<input type="text" class="form-control" required="required" id="item_name" name="item_name" value=""
placeholder="请输入项目名称">
</div>
</div> <div class="form-group">
<label for="standard_value" class="col-sm-3 control-label">标准值</label>
<div class="col-sm-9">
<input type="text" class="form-control" required="required" name="standard_value" value="" id="standard_value"
placeholder="标准值">
</div>
</div>
<div class="form-group">
<label for="price" class="col-sm-3 control-label">价格</label>
<div class="col-sm-9">
<input type="text" required="required" class="form-control" name="price" value="" id="price"
placeholder="价格">
</div>
</div> <div class="form-group">
<label for="remark" class="col-sm-3 control-label">备注</label>
<div class="col-sm-9">
<textarea class="form-control" name="remark" value="" id="remark"
placeholder="备注"></textarea>
</div>
</div> </div>
<div class="modal-footer">
<div class="row">
<div class="form-group">
<div class="col-sm-4 col-sm-offset-4">
<button class="btn btn-primary " type="submit" id="btn_jcxxwhSava"><i class="fa fa-check"></i>&nbsp;保存</button>&nbsp;&nbsp;
<button class="btn btn-warning" data-dismiss="modal" id="btn_close" type="button"><i class="glyphicon glyphicon-remove"></i>&nbsp;关闭</button> </div>
</div>
</div>
</div>
</form>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>

效果图:

bootstrap 弹框的更多相关文章

  1. bootstrap弹框

    http://v3.bootcss.com/javascript/#modals 参考bootstrap官网 模态框做php后端 前端一直不行,但是很多时候 用到ajax都要用到弹框,一直在代码里面找 ...

  2. bootstrap 弹框使用

    首先需要准备bootstrap.css,bootstrap .js  jquery 我这里有写好的下载地址如下: https://pan.baidu.com/s/1miMahXe  秘钥:tgts & ...

  3. bootstrap弹框去除遮罩层效果

    是通过css解决这个问题,核心css代码如下: .modal-backdrop { filter: alpha(opacity=)!important; opacity: !important; } ...

  4. 参考bootstrap中的popover.js的css画消息弹框

    前段时间小颖的大学同学给小颖发了一张截图,图片类似下面这张图: 小颖当时大概的给她说了下,其实小颖也不知道上面那个三角形怎么画嘻嘻,给她说了DOM结构,具体的css让她自己百度,今天小颖自己参考boo ...

  5. 自己写的基于bootstrap风格的弹框插件

    自己写的一款基于bootstrap风格的弹框插件,暂时只有确认框.提示框.后续功能扩展.bug修改再更新. ;(function($){ //默认参数 var PARAMS; var DEFAULTP ...

  6. Bootstrap弹出框(modal)垂直居中

    最近在做一个eit项目,由于此项目里面一些框架要遵循nttdata的一些规则,故用到了Bootstrap这个东东,第一次碰到这个东东,有很大抵触,觉得不好,但用起来我觉得和别的弹出框真没什么两样.废话 ...

  7. bootstrap 弹出框点击其他区域时弹出框不消失选项设置

    默认情况下,bootstrap 弹出框点击其他区域时,弹出框会自动关闭,在很多时候,我们可能会希望达到和原生弹出框一样的效果,避免不小心点击其他区域时弹框自动隐藏,尤其是对于一些复杂的表单,重复填写可 ...

  8. Bootstrap 模态框(也可以说的弹出层)

    最近在尝试使用bootstrap的模态框 使用模态框主要要引入一下几个js和css: bootstrap.css jquery.1.9.1.js(这个可以灵活选择) bootstrap.js html ...

  9. bootstrap弹出框

    要想使用Bootstrap Popover(弹出框)则必须引入其依赖的文件: jquery.js这个必须的(还是要写在其他js前面,bootstrap是依赖jquery的哦) bootstrap-to ...

随机推荐

  1. Spring Bean的ref属性和IoC注入集合

    这是一个Demo 1.Phone.java package com.cn.pojo; public class Phone { private String name; private double ...

  2. Xampp PHPStorm XDebug配置

    (1)https://xdebug.org/download.php 下载当前Xampp对应的XDebug版本. (2)将该dll放入C:\xampp\php\ext (3)修改Control Pan ...

  3. Newtonsoft.Json 的基本用法

    Ø  前言 说起 C# 对 JSON 的操作(序列化与反序列化),大家都会想到 JavaScriptSerializer.DataContractJsonSerializer 与 Newtonsoft ...

  4. luogu P3235 [HNOI2014]江南乐

    传送门 这题又是我什么时候做的(挠头) 首先是个和SG函数有关的博弈论,SG=0则先手必败.显然一堆石子就是一个游戏,而若干堆石子的SG值就是每堆SG的异或和,所以算出每堆石子SG就能知道答案 然后怎 ...

  5. Python7 - 面向对象编程进阶

    本节内容: 面向对象高级语法部分 经典式 VS 新式类 静态方法,类方法,属性方法 类的特殊方法 反射 异常处理 Socket开发基础 面向对象高级语法部分 经典类 VS 新式类 先看一串代码: cl ...

  6. 集合-HashSet

    参考博客:https://www.cnblogs.com/runwulingsheng/p/5208762.html https://www.cnblogs.com/ysocean/p/6555373 ...

  7. 【NLP CS224N笔记】Lecture 2 - Word Vector Representations: word2vec

    I. Word meaning Meaning的定义有很多种,其中有: the idea that is represented by a word,phrase,etc. the idea that ...

  8. spring-session+Redis实现Session共享

    关于session共享的方式有多种: (1)通过nginx的ip_hash,根据ip将请求分配到对应的服务器 (2)基于关系型数据库存储 (3)基于cookie存储 (4)服务器内置的session复 ...

  9. OGG选择捕捉和应用模式

    本章包含的信息可帮助您确定适用于数据库环境的捕获和应用模式. 主题: Oracle GoldenGate捕获和应用进程概述 决定使用哪种捕捉方法 决定使用哪种应用方法 同时使用不同的捕捉和应用模式 切 ...

  10. 手写代码 - java.lang.String/StringBuilder 相关

    语言:Java 9-截取某个区间的string /** * Returns a string that is a substring of this string. The * substring b ...