窗体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

最新文章

  1. 从Nginx的Web请求处理机制中剖析多进程、多线程、异步IO
  2. Android 横竖屏切换小结
  3. [转]Ubuntu下使用Jni开发例子
  4. 编写高质量代码改善C#程序的157个建议[C#闭包的陷阱、委托、事件、事件模型]
  5. FireFox插件
  6. ProxyFactory的一个问题
  7. _doPostBack用法总结
  8. java_jdbc_spring框架查询操作简例
  9. 如何使用Google APIs和Google应用系统集成(7)----在里面JSON兑换XML数据处理,JSON数据包括违规XML数据规范:XML节点名称不支持号码Java解
  10. CSharp设计模式读书笔记(23):模板方法模式(学习难度:★★☆☆☆,使用频率:★★★☆☆)
  11. Entity Framework,TransactionScope 混合使用的问题讨论
  12. Android Studio文件目录介绍
  13. PHP 魔术方法 __call 与 __callStatic 方法
  14. Java Collection(转载)
  15. 怎么轻松学习JavaScript
  16. 1、js的基本对象和垃圾回收
  17. makefile笔记1 - 初识makefile
  18. a,abbr,address,area,article, aside, audio标签文档
  19. python2的比较函数,cmp
  20. Caused by: java.lang.ClassNotFoundException: javax.xml.bind.Validation

热门文章

  1. 372 Super Pow 超级次方
  2. 向listview控件中添加数据库数据
  3. 【Python-2.7】大小写转换函数
  4. JavaScript 单例,Hash,抛异常
  5. HDU_2544_最短路
  6. JMeter怎样测试WebSocket,示例演示(二)
  7. CAD使用SetxDataString写数据(网页版)
  8. Linux System
  9. maven deploy时报错
  10. background 背景类八大属性