窗体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>
使用方法具体可以从官方网站下载带例子的压缩包,很容易上手。

  1. $("#element-id").modal();引入内容块
  2. $.modal("<div><h1>SimpleModal</h1></div>"); 直接添加html代码
  3.  
  4. $("#element-id").modal({options}); 
  5. $.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. SQL数据库基础————委托

    委托:也称为代理,事件也是一种委托:定义在类的最外面 1.定义委托关键字:delegate函数签名:签名和函数保持一致定义委托的时候要根据函数来定义public delegate int First( ...

  2. LN : leetcode 217 Contains Duplicate

    lc 217 Contains Duplicate 217 Contains Duplicate Given an array of integers, find if the array conta ...

  3. CSS垂直居中和水平居中的几种方法

    垂直居中 方法一 这个方法把div 的显示方式设置为表格,因此我们可以使用表格的 vertical-align属性. <!DOCTYPE html> <html lang=" ...

  4. 2014中秋节,用java为QQ游戏美女找茬写辅助

    引子        今年中秋闲在家,总要找点事做.        前几天开始学python,很早之前就有计划拿下这门语言了,可惜一直拖到现在……不可否认,我也是个拖沓症患者.在学习python的过程中 ...

  5. Pro ASP.NET Core MVC 第6版 第二章(后半章)

    增加动态输出 整个web应用平台的关注点在于构建并显示动态输出内容.在MVC里,控制器负责构建一些数据并将其传给视图.视图负责渲染成HTML. 从控制器向视图传递数据的一种方式是使用ViewBag 对 ...

  6. python计算auc指标

    1.安装scikit-learn 1.1Scikit-learn 依赖 Python (>= 2.7 or >= 3.3), NumPy (>= 1.8.2), SciPy (> ...

  7. Windows提高_1.3文件操作

    文件操作 不带句柄的文件操作 // 1. 拷贝文件,第三个参数为 FALSE 表示会覆盖 // CopyFile(L"D:\\1.txt", L"E:\\2.txt&qu ...

  8. windows如何统计端口的连接数

    习惯了linux的系统管理员,对linux的命令行工具总是印象极深,几乎所有的管理都可以在命令行下完成.命令行工具是linux系统管理的主流. 而使用windows是,因为图形化的界面,大家习惯了图形 ...

  9. CAD控件:COM接口实现自定义实体

    1. 实现步骤: 3 1. 实现步骤: 参考例子 :Src\MxDraw5.2\samples\ie\iedemoTest.htm 1) 增加自定义实体对象 调用DrawCustomEntity函数, ...

  10. 'dict' object is not callable

    今天学py的map函数时,由于在上面定义了一个dict类型的变量(取的名是map),所以编译后报了这么一个错,哎,以后学py命名要小心了