窗体API定义丰富,而且使用也很容易上手。
官方地址:http://www.ericmmartin.com/projects/simplemodal/
从官方下载插件,在文件中引用
<script type='text/javascript' src='js/jquery.js'></script>
<script type='text/javascript' src='js/jquery.simplemodal.js'></script>
使用方法具体可以从官方网站下载带例子的压缩包,很容易上手。

$("#element-id").modal();引入内容块

$.modal("<div><h1>SimpleModal</h1></div>"); 直接添加html代码

$("#element-id").modal({options}); 

$.modal("<div><h1>SimpleModal</h1></div>", {options}); 带自定义选项的使用

现在看看它的自定义选项:
appendTo :将弹出框添加到的父容器,参数为css选择器
opacity :透明度
overlayId :遮罩层id
overlayCss :{Object}定义遮罩层样式
containerId :弹出窗体容器id
containerCss :定义容器的样式
dataId :内容层id
containerCss :内容层的样式
minHeight :最小高度
minWidth :最小宽度
maxHeight :最大高度maxWidth :最大宽度
autoResize:是否自适应大小
zIndex :弹出层的z-index
close :是否允许关闭
closeHTML :自定义关闭按钮
closeClass :关闭层样式
overlayClose :点击遮罩层是否关闭弹出窗体
position :数组 [top, left] 自定义弹出窗体位置
onOpen :弹出窗体打开时候的回调函数
onShow :弹出窗体显示时候的回调函数
onClose :弹出窗体关闭时候的回调函数

官网:http://www.ericmmartin.com/projects/simplemodal/

Options

The following is a list of current options. Default values are indicated with: [Type:Value]

    • appendTo [String:'body']
      The jQuery selector to append the elements to. For ASP.NET, use 'form'.
    • focus [Boolean:true] (Changed in 1.4)
      Focus in the first visible, enabled element?
    • opacity [Number:50]
      The opacity value for the overlay div, from 0 - 100
    • overlayId [String:'simplemodal-overlay']
      The DOM element id for the overlay div
    • overlayCss [Object:{}]
      The CSS styling for the overlay div
    • containerId [String:'simplemodal-container']
      The DOM element id for the container div
    • containerCss [Object:{}]
      The CSS styling for the container div
    • dataId [String:'simplemodal-data']
      The DOM element id for the data div
    • dataCss [Object:{}]
      The CSS styling for the data div
    • minHeight [Number:null]
      The minimum height for the container
    • minWidth [Number:null]
      The minimum width for the container
    • maxHeight [Number:null]
      The maximum height for the container. If not specified, the window height is used.
    • maxWidth [Number:null]
      The maximum width for the container. If not specified, the window width is used.
    • autoResize [Boolean:false] (Changed in 1.4)
      Resize the container if it exceeds the browser window dimensions?
    • autoPosition [Boolean:true] (Changed in 1.4)
      Automatically position the container upon creation and on window resize?
    • zIndex [Number: 1000]
      Starting z-index value
    • close [Boolean:true]
      If true, closeHTMLescClose and overClose will be used if set. If false, none of them will be used.
    • closeHTML [String:'']
      The HTML for the default close link. SimpleModal will automatically add the closeClass to this element.
    • closeClass [String:'simplemodal-close']
      The CSS class used to bind to the close event
    • escClose [Boolean:true]
      Allow Esc keypress to close the dialog?
    • overlayClose [Boolean:false]
      Allow click on overlay to close the dialog?
    • position [Array:null]
      Position of container [top, left]. Can be number of pixels or percentage
    • persist [Boolean:false]
      Persist the data across modal calls? Only used for existing DOM elements. If true, the data will be maintained across modal calls, if false, the data will be reverted to its original state.
    • modal [Boolean:true] (Added in 1.3.4. Name changed from transient in 1.3.5))
      User will be unable to interact with the page below the modal or tab away from the dialog. If false, the overlay, iframe, and certain events will be disabled allowing the user to interact with the page below the dialog.
    • onOpen [Function:null]
      The callback function used in place of SimpleModal's open
    • onShow [Function:null]
      The callback function used after the modal dialog has opened
    • onClose [Function:null]
      The callback function used in place of SimpleModal's close

jquery simple modal的更多相关文章

  1. jQuery BlockUI Plugin Demo 5(Simple Modal Dialog Example)

    Simple Modal Dialog Example This page demonstrates how to display a simple modal dialog. The button ...

  2. iframe中的jquery ui modal dialog 覆盖父窗口

    在iframe中 使用jquery ui dialog,弹出后可以覆盖父窗体 ///iframe中的jquery ui modal dialog 覆盖父窗口 function openDialog() ...

  3. 使用HTML5、CSS3和jQuery增强网站用户体验[留存]

    记得几年前如果你需要添加一些互动元素到你的网站中用来改善用户体验?是不是立刻就想到了flash实现?这彷佛年代久远的事了.使用现在最流行的Web技术HTML5,CSS3和jQuery,同样也可以实现类 ...

  4. 15款最好的 jQuery Modal(模态窗口)插件

    jQuery 模态窗口插件帮助网站开发人员显示网页中的特定内容,让用户聚焦到这个地方.模态窗口是嵌入到当前网页中,不用重定向到新网页的弹出窗口.这种技术可以用在图像画廊,电子商务网站,登陆框,电子邮件 ...

  5. jQuery遮罩插件 jquery.blockUI.js

    Overview jQuery BlockUI 插件可以在不同锁定浏览器的同时,模拟同步模式下发起Ajax请求的行为.该插件激活时,会组织用户在页面进行的操作,直到插件被关闭.BlockUI通过向DO ...

  6. 使用 jQuery UI 和 jQuery 插件构建更好的 Web 应用程序

    简介: 对于那些使用 JavaScript 和 jQuery 库从桌面应用程序转向 Web 应用程序的开发人员来说,他们还不习惯去考虑应用程序基本的外观,因为这些以前都是由操作系统来处理的.了解 jQ ...

  7. 16款最佳的 jQuery Time Picker 时间选择插件

    jQuery 插件可以为你做许多事情,你可以很容易地把这些插件集成到您的网站.网络上的 jQuery 日期选择器和日历插件很多,但找不到很满意的时间选择器插件. 在这里,我们收集了最好的一组 jQue ...

  8. BootStrap入门教程 (四) :JQuery类库插件(模态窗口,滚动监控,标签效果,提示效果,“泡芙”效果,警告区域,折叠效果,旋转木马,输入提示)

    上讲回顾:Bootstrap组件丰富同时具有良好可扩展性,能够很好地应用在生产环境.这些组件包括按钮(Button),导航(Navigation),缩略图( thumbnails),提醒(Alert) ...

  9. 21个很棒的jQuery分页插件下载

    分页是指将一个大内容划分为各种不同的页面,因此网站的分页是一个很重要的部分,必须让内容有组织性和易于访问.分页有各两种不同的方式,手动跟自动.最受欢迎简单和广泛的方法是jQuery插件.下面我们收集了 ...

随机推荐

  1. 238 Product of Array Except Self 除自身以外数组的乘积

    一个长度为 n 的整形数组nums,其中 n > 1,返回一个数组 output ,其中 output[i] 等于nums中除nums[i]以外所有元素的乘积.不用除法 且在O(n)内解决这个问 ...

  2. Spark SQL概念学习系列之Spark SQL入门(八)

    前言 第1章   为什么Spark SQL? 第2章  Spark SQL运行架构 第3章 Spark SQL组件之解析 第4章 深入了解Spark SQL运行计划 第5章  测试环境之搭建 第6章 ...

  3. Spring.Net学习笔记(0)-错误汇总

    1.错误一:ObjectDefinitionStoreException "Spring.Objects.Factory.ObjectDefinitionStoreException&quo ...

  4. Json-->Newton.Json.dll的使用方法

    Newton.Json.dll  for .NET2.0 实体1 public class Student    {        public string ID { get; set; }     ...

  5. 微信小程序资料总结

    http://blog.csdn.net/ZCLengendary/article/details/54312030  --添加html标签与处理 https://www.cnblogs.com/HD ...

  6. HDU_6017_Girls love 233_(dp)(记忆化搜索)

    Girls Love 233  Accepts: 30  Submissions: 218  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: ...

  7. wparam , lparam 传递消息

    01.WM_PAINT消息 LOWORD(lParam)是客户区的宽,HIWORD(lParam)是客户区的高 02.滚动条WM_VSCROLL或WM_HSCROLL消息 LOWORD(wParam) ...

  8. 在WEB项目中调用QQ通讯组件打开QQ聊天界面

    在很多WEB项目中,需要提供在线服务的功能,加上自己的联系方式,例如:QQ,不用添加QQ好友也可以交谈,那这到底是怎么实现的呢? 对于这个功能,需要提到一个组件,即“QQ通讯组件”.QQ通讯组件是一种 ...

  9. Java运算符法则

    JAVA运算符法则 运算符是一种特殊的符号,用于表示数据的运算,赋值和比较等: 算术运算符 正号+,负号-,加+,减-,乘*,除/,余或取模%,自增++,自减--,字符串相加+ 正号负号运算符代表运算 ...

  10. Java真实笔试题一

    PS:昨天去笔试后,发现自己对于JavaSE的基础部分还是有些薄弱的地方,特将昨天自己不是太清楚的地方记录下来,巩固基础. 子类继承父类静态方法的问题 public class Study { pub ...