jQuery插件之simplemodal
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 - 100overlayId[String:'simplemodal-overlay']
The DOM element id for the overlay divoverlayCss[Object:{}]
The CSS styling for the overlay divcontainerId[String:'simplemodal-container']
The DOM element id for the container divcontainerCss[Object:{}]
The CSS styling for the container divdataId[String:'simplemodal-data']
The DOM element id for the data divdataCss[Object:{}]
The CSS styling for the data divminHeight[Number:null]
The minimum height for the containerminWidth[Number:null]
The minimum width for the containermaxHeight[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 valueclose[Boolean:true]
If true,closeHTML,escCloseandoverClosewill 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 eventescClose[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 percentagepersist[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 fromtransientin 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 openonShow[Function:null]
The callback function used after the modal dialog has openedonClose[Function:null]
The callback function used in place of SimpleModal's close
jQuery插件之simplemodal的更多相关文章
- 第7章 jQuery插件的使用和写法
第7章 jQuery插件的使用和写法 插件又称扩展,是一种遵循一定规范的应用程序接口写出来的程序. 插件的编写思想基于面向对象. 获取最新的插件可以查看jquery官网:http://plugins. ...
- jquery插件库
jQuery由美国人John Resig创建,至今已吸引了来自世界各地的众多javascript高手加入其team. jQuery是继prototype之后又一个优秀的Javascrīpt框架.其经典 ...
- 强烈推荐240多个jQuery插件提供下载
jQuery 是继 prototype 之后又一个优秀的 Javascript 框架.其宗旨是—写更少的代码,做更多的事情.它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不及 的 ...
- 240多个jQuery插件
概述 jQuery 是继 prototype 之后又一个优秀的 Javascript 框架.其宗旨是—写更少的代码,做更多的事情.它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不 ...
- 海量jQuery插件
转自:http://blog.csdn.net/zzq58157383/article/details/6900142 提醒大家在使用的时候注意jQuery包的版本问题,最好是使用相同的版本,因为使用 ...
- jquery插件下载地址
以下是本人收集的jquery插件下载地址: .............版本自行选择. jquery官网:http://jquery.com/ jquery.validate.js 官网下载地址:htt ...
- 转 常用JQuery插件整理
虽然自己也写过插件,但JQuery插件种类的繁多,大多时候,我还是使用别人写好的插件,这些都是我用了同类插件里较为不错的一些,今天就整理一下公开放出来. UI: jquery.HooRay(哈哈,自己 ...
- 转 jquery插件--241个jquery插件—jquery插件大全
241个jquery插件—jquery插件大全 jquery插件jqueryautocompleteajaxjavascriptcoldfusion jQuery由美国人John Resig创建,至今 ...
- jquery插件推荐
jQuery 是继 prototype 之后又一个优秀的 Javascript 框架.其宗旨是—写更少的代码,做更多的事情.它是轻量级的 js 库(压缩后只有21k) ,这是其它的 js 库所不及的, ...
随机推荐
- openssl生成https证书 (转)
1.首先要生成服务器端的私钥(key文件):openssl genrsa -des3 -out server.key 1024运行时会提示输入密码,此密码用于加密key文件去除key文件口令的命令:o ...
- WinForm------TreeList属性介绍
转载: http://blog.csdn.net/fwj380891124/article/details/6888077 treeList1.LookAndFeel.UseWindowsXPThem ...
- nodejs fs module
fs.watchFile(filename[, options], listener)# Added in: v0.1.31 filename <String> | <Buffer& ...
- 【codeblocks配置】C对Mysql数据的查询
codeblocks 编写C文件连接mysql数据库 codeblocks 设置.1.设置lib库文件: Settings->Compiler settings->Linker setti ...
- delphi---控件使用
1.TBitBtn控件 属性:Glyph,指定要显示的位图: Layout ,设置位图在按钮的位置:Kind,要想用自设位图,这个属性要设置bkCustom; 2.TTreeView TTree ...
- PyCharm光标变粗的解决办法
pycharm中光标变粗,如下: 此时变成了改写模式,只需要按下键盘的insert键即可
- 使用node的插件UglifyJs来合并和压缩文件
code: var fs = require('fs'); var jsp = require("./UglifyJS-master/uglify-js").parser; var ...
- clipboard复制剪贴板功能,以及用requirejs时报错---Uncaught ReferenceError: Clipboard is not defined
zeroclipboard是走的flash插件,手机浏览器是不支持的,所以不得不舍弃之,用clipboard,clipboard不需要flash就可以完成复制剪切等功能,而且可以兼容pc,移动端,下面 ...
- css 常用代码解析
.cBan_1 .e2-pro li a{ display: block; -webkit-transition: all 0.3s linear;transition: all 0.3s linea ...
- php ceil() 函数向上舍入为最接近的整数。
代码: <?php echo(ceil(0.60); echo(ceil(0.40); echo(ceil(); echo(ceil(5.1); echo(ceil(-5.1); echo(ce ...