参考网址:http://v3.bootcss.com/(能抄不写)

1、大模态框

图片效果图:

代码:(button的属性data-target对应的是具体模态框的class)

<!-- Large modal -->

<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Large modal</button>

<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">

<div class="modal-dialog modal-lg" role="document">

<div class="modal-content">

...

</div>

</div>

</div>

2、小模态框

图片效果图:

代码:

<!-- Small modal -->

<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-sm">Small modal</button>

<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">

<div class="modal-dialog modal-sm" role="document">

<div class="modal-content">

...

</div>

</div>

</div>

3、我们的模态框

图片效果图

代码:

<div class="modal fade" tabindex="-1" role="dialog">

<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">Modal title</h4>

</div>

<!--头部结束-->

<!--内容开始-->

<div class="modal-body">

<p>One fine body&hellip;</p>

</div>

<!--内容结束-->

<!--底部开始-->

<div class="modal-footer">

<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>

<button type="button" class="btn btn-primary">Save changes</button>

</div>

<!--底部结束-->

</div>

<!-- /.modal-content -->

</div>

<!-- /.modal-dialog -->

</div>

<!-- /.modal -->

4、禁止掉动画:如果你不需要模态框弹出时的动画效果(淡入淡出效果),删掉 .fade 类即可。

5、js手动切换、打开、关闭模态框

$('#myModal').modal('toggle');

$('#myModal').modal('show');

$('#myModal').modal('hide');

6、ps注意:

(1)不支持同时打开多个模态框;

(2)模态框的 HTML 代码放置的位置,也就是说,尽量作为 body 标签的直接子元素。


Bootstrap-模态框 modal.js的更多相关文章

  1. bootstrap模态框modal使用remote第二次加载显示相同内容解决办法

    bootstrap模态框modal使用remote动态加载内容,第二次加载显示相同内容解决办法 bootstrap的modal中,使用remote可以动态加载页面到modal-body中,并弹窗显示 ...

  2. Bootstrap模态框(modal)垂直居中

    http://v3.bootcss.com/ 自己也试了改了几种方式也不容乐观,发现在窗口弹出之前是获取不到$(this).height()的值,本想着是用($(window).height()-$( ...

  3. 模态框 modal.js

    模态框经过了优化,更加灵活,以弹出对话框的形式出现,具有最小和最实用的功能集. 不支持模态框重叠 千万不要在一个模态框上重叠另一个模态框.要想同时支持多个模态框,需要自己写额外的代码来实现. 模态框的 ...

  4. Bootstrap 模态框(Modal)插件

    页面效果: html+js: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...

  5. 禁用 Bootstrap 模态框(Modal) 点击空白时自动关闭

    在做项目的时候,来了这么一个需求,要求打开模态框后,点击空白的地方不让他自动关闭,只能点击关闭按钮才能关闭. 有了需求,就开始查找资料寻求解决的方法. 我找到的解决方法如下: $('#registCo ...

  6. Bootstrap模态框modal的高度和宽度设置

    (1)高度 将style=“height:900px”放在<div class = "modal-dialog">或者更外层上,整个模态框的高度不会发生变化 如下图所示 ...

  7. bootstrap模态框modal使用remote动态加载内容,第二次加载显示相同内容解决办法

    bootstrap的modal中,使用remote可以动态加载页面到modal-body中,并弹窗显示 如果提供的是 URL,将利用 jQuery 的 load 方法从此 URL 地址加载要展示的内容 ...

  8. Bootstrap模态框(MVC)

    BZ这篇博客主要是为大家介绍一下MVC如何弹出模态框.本文如果有什么不对的地方,希望大神们多多指教,也希望和我一样的小菜多多学习.BZ在这里谢过各位. 首先要在页面加上一个点击事件: @Html.Ac ...

  9. Bootstrap3模态框Modal垂直居中样式

    1,Bootstrap 模态框插件Bootbox垂直居中样式: <!DOCTYPE html> <html lang="en"> <head> ...

  10. js控制Bootstrap 模态框(Modal)插件

    js控制Bootstrap 模态框(Modal)插件 http://www.cnblogs.com/zzjeny/p/5564400.html

随机推荐

  1. Adapter之GridAdapter

    前言: 在我们写界面的时候想让我们展示的页面是网格的,这是我们可以使用GridAdapter,这个和listView的使用有相似之处,如果学过ListView的话还是很简单的 正文: 下面我们来看看G ...

  2. C#中使用设置(Settings.settings) Properties.Settings.Default .(配置文件相当重要)

    C#中使用设置(Settings.settings) Properties.Settings.Default . 2016年08月04日 15:02:43 zxd9790902 阅读数:10664更多 ...

  3. 04.swoole学习笔记--webSocket服务器

    <?php //创建webSocket服务器 $serv=); //获取请求 //on //open 建立连接 $serv:服务器 $request:客户端信息 $serv->on('op ...

  4. flower——知识总结

    创建主外键关联的话,外键表的外键字段一定要与主键表的主键字段相一致,包括字段类型,字段长度,字段符号等等 inverse="true" 将控制权交给对方,在一对多的关系中,一端控制 ...

  5. C语言备忘录——qsort

    写了这么久的排序感觉还是用现成的最舒服.其实C语言其实自己带了一个快速排序在stdlib 库里,但是其函数调用的接口过于复杂,所以让人望而却步.为了加深自己的记忆,所以写下这篇博客 先来看一下函数原型 ...

  6. 51nod 1065:最小正子段和

    1065 最小正子段和 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题  收藏  取消关注 N个整数组成的序列a[1],a[2],a[3],-,a[n],从中选出一 ...

  7. SSM文件上传要点总结

    文件的上传要点: 1.表单方面:enctype="multitype/form-data" 编码方式选择混编码 input 类型采用file 2.实体类一定要进行序列化,也就是im ...

  8. 降维之奇异值分解(SVD)

    看了几篇关于奇异值分解(Singular Value Decomposition,SVD)的博客,大部分都是从坐标变换(线性变换)的角度来阐述,讲了一堆坐标变换的东西,整了一大堆图,试图“通俗易懂”地 ...

  9. 机器学习(ML)一之 Linear Regression

    一.线性回归 1.模型 2.损失函数 3.优化函数-梯度下降 #!/usr/bin/env python # coding: utf-8 import torch import time # init ...

  10. android导入项目build错误

    android studio apply script build.gradle 卡死 buildscript { repositories { maven{ url 'http://maven.al ...