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 库所不及的, ...
随机推荐
- JAVASE 面试总结(1)
1.什么是Java虚拟机?为什么Java被称作是"平台无关的编程语言"?Java虚拟机是一个可以执行Java字节码的虚拟机进程.Java源文件被编译成能被Java虚拟机执行的字节码 ...
- JavaWeb---总结(十四)JSP原理
一.什么是JSP? JSP全称是Java Server Pages,它和servle技术一样,都是SUN公司定义的一种用于开发动态web资源的技术. JSP这门技术的最大的特点在于,写jsp就像在写h ...
- [中英双语] 数学缩写列表 (List of mathematical abbreviations)
List of mathematical abbreviations From Wikipedia, the free encyclopedia 数学缩写列表 维基百科,自由的百科全书 This ar ...
- linq 之 Distinct的使用
public class Product { public string Name { get;set;} public int Code { get; set; } } class ProductC ...
- PHP 出现 502 解决方案
原文:http://www.ahlinux.com/php/10319.html nginx+php 出现502 bad gateway,一般这都不是nginx的问题,而是由于 fastcgi或者ph ...
- C#----Get和Set在属性中的使用
Get和Set在属性中的作用: 第一个作用:保证数据的安全性,对字段进行了有效的保护. 第二个作用:起到监视作用 private int width=0; public int Width { get ...
- /MD, /MT, /LD (Use Run-Time Library)
https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx
- ecshop商品-》购买记录
注意事项:{insert name='bought_notes' id=$id} 有了产品ID一切都好说 html代码 <!-- #BeginLibraryItem "/libra ...
- 如何在ubuntu中启用SSH服务
如何在ubuntu14.04 中启用SSH服务 开篇科普: SSH 为 Secure Shell 的缩写,由 IETF 的网络工作小组(Network Working Group)所制定:SSH 为 ...
- django笔记-模型数据模板呈现过程记录(多对多关系)
首先,推荐一个网址:http://www.tuicool.com/articles/BfqYz2F,因为这里的比我的要有条理,更有利于各位的理解. 以下仅为为个人一次不完整的笔记: 环境:ubuntu ...