1、simplemodal在内部定义了如下css类

simplemodal-overlay:遮罩

simplemodal-container:弹出窗口容器

simplemodal-wrap

simplemodal-data

2、关闭窗口

simplemodal自动为弹出窗口内class是“simplemodal-close”的元素绑定了关闭函数。故,只要添加这个类就可以关闭功能。

也可以调用$.modal.close()的方式关闭打开的弹出窗口。

如果不想用插件内定的class名称为关闭函数类,可以自定义,方法如下:

$.modal.defaults.closeClass = "modalClose";

当然,如果想修改多个默认参数,可以使用如下代码:

$.extend($.modal.defaults,{

  closeClass:"modalClose",

  closeHTML:"<a href='#'>Close</a>"

});

3、现在看看它的自定义选项:
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 :弹出窗体关闭时候的回调函数

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插件之simplemodal的更多相关文章

  1. 第7章 jQuery插件的使用和写法

    第7章 jQuery插件的使用和写法 插件又称扩展,是一种遵循一定规范的应用程序接口写出来的程序. 插件的编写思想基于面向对象. 获取最新的插件可以查看jquery官网:http://plugins. ...

  2. jquery插件库

    jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多javascript高手加入其team. jQuery是继prototype之后又一个优秀的Javascrīpt框架.其经典 ...

  3. 强烈推荐240多个jQuery插件提供下载

    jQuery 是继 prototype 之后又一个优秀的 Javascript 框架.其宗旨是—写更少的代码,做更多的事情.它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不及 的 ...

  4. 240多个jQuery插件

    概述 jQuery 是继 prototype 之后又一个优秀的 Javascript 框架.其宗旨是—写更少的代码,做更多的事情.它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不 ...

  5. 海量jQuery插件

    转自:http://blog.csdn.net/zzq58157383/article/details/6900142 提醒大家在使用的时候注意jQuery包的版本问题,最好是使用相同的版本,因为使用 ...

  6. jquery插件下载地址

    以下是本人收集的jquery插件下载地址: .............版本自行选择. jquery官网:http://jquery.com/ jquery.validate.js 官网下载地址:htt ...

  7. 转 常用JQuery插件整理

    虽然自己也写过插件,但JQuery插件种类的繁多,大多时候,我还是使用别人写好的插件,这些都是我用了同类插件里较为不错的一些,今天就整理一下公开放出来. UI: jquery.HooRay(哈哈,自己 ...

  8. 转 jquery插件--241个jquery插件—jquery插件大全

    241个jquery插件—jquery插件大全 jquery插件jqueryautocompleteajaxjavascriptcoldfusion jQuery由美国人John Resig创建,至今 ...

  9. jquery插件推荐

    jQuery 是继 prototype 之后又一个优秀的 Javascript 框架.其宗旨是—写更少的代码,做更多的事情.它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不及的, ...

随机推荐

  1. POJ3612:Telephone Wire

    传送门 一道很棒的DP题目. 裸的DP方程很好搞: $f[i][j]=min \{ f[i-1][k]+ C \times |k-j| +(k-a[i])^2 \}$ 这个复杂度显然无法承受,考虑优化 ...

  2. java泛型中<?>和<T>有什么区别?

      public static void printColl(ArrayList<?> al){                Iterator<?> it = al.iter ...

  3. jquery输出ajax返回数据中的时间戳转化为日期时间的函数

    //第一种 function getLocalTime(nS) { ).toLocaleString().replace(/:\d{,}$/,' '); } alert(getLocalTime()) ...

  4. Linux 下 Oracle 内核参数优化

    数据库的性能优化涉及到整个数据库运行环境的方方面面,诸如操作系统,Oracle自身,存储,网络等等几个大块.而操作系统则是Oracle稳定运行与最大化性能的基石.本文主要描述基于Linux系统下 Or ...

  5. 4个mysql客户端工具的比较

    mysql是我以前学习和练习所使用的数据,现在在工作中也在使用,之前公司里用oracle,我在做自己的东西的时候觉得用oracle太不方便,于是就找了mysql(当时也考虑过sqlserver,觉得还 ...

  6. oc面向对象特性: 多态

    多态:不同对象以自己的方式响应相同的消息的能力叫做多态.   多态的主要好处就是简化了编程接口.在类与类之间可以重复命名. 下面的例子是一个彩色打印机和黑白打印机这两种打印机,然后Person类中有一 ...

  7. JavaWeb学习笔记——XML解析

    DOM解析操作 只在跟节点<addresslist>下面建立一个子节点<name> <?xml version="1.0" encoding=&quo ...

  8. NGINX 配置404错误页面转向

    什么是404页面 如果碰巧网站出了问题,或者用户试图访问一个并不存在的页面时,此时服务器会返回代码为404的错误信息,此时对应页面就是404页面.404页面的默认内容和具体的服务器有关.如果后台用的是 ...

  9. PHP ob系列函数详解

    一. 相关函数简介:    1.Flush:刷新缓冲区的内容,输出.    函数格式:flush()    说明:这个函数经常使用,效率很高.    2.ob_start :打开输出缓冲区    函数 ...

  10. Hadoop FS shell commands

    命令格式:hadoop fs -command -option args appendToFileUsage: hadoop fs -appendToFile <localsrc> ... ...