jquery simple modal
窗体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 - 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 simple modal的更多相关文章
- 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 ...
- iframe中的jquery ui modal dialog 覆盖父窗口
在iframe中 使用jquery ui dialog,弹出后可以覆盖父窗体 ///iframe中的jquery ui modal dialog 覆盖父窗口 function openDialog() ...
- 使用HTML5、CSS3和jQuery增强网站用户体验[留存]
记得几年前如果你需要添加一些互动元素到你的网站中用来改善用户体验?是不是立刻就想到了flash实现?这彷佛年代久远的事了.使用现在最流行的Web技术HTML5,CSS3和jQuery,同样也可以实现类 ...
- 15款最好的 jQuery Modal(模态窗口)插件
jQuery 模态窗口插件帮助网站开发人员显示网页中的特定内容,让用户聚焦到这个地方.模态窗口是嵌入到当前网页中,不用重定向到新网页的弹出窗口.这种技术可以用在图像画廊,电子商务网站,登陆框,电子邮件 ...
- jQuery遮罩插件 jquery.blockUI.js
Overview jQuery BlockUI 插件可以在不同锁定浏览器的同时,模拟同步模式下发起Ajax请求的行为.该插件激活时,会组织用户在页面进行的操作,直到插件被关闭.BlockUI通过向DO ...
- 使用 jQuery UI 和 jQuery 插件构建更好的 Web 应用程序
简介: 对于那些使用 JavaScript 和 jQuery 库从桌面应用程序转向 Web 应用程序的开发人员来说,他们还不习惯去考虑应用程序基本的外观,因为这些以前都是由操作系统来处理的.了解 jQ ...
- 16款最佳的 jQuery Time Picker 时间选择插件
jQuery 插件可以为你做许多事情,你可以很容易地把这些插件集成到您的网站.网络上的 jQuery 日期选择器和日历插件很多,但找不到很满意的时间选择器插件. 在这里,我们收集了最好的一组 jQue ...
- BootStrap入门教程 (四) :JQuery类库插件(模态窗口,滚动监控,标签效果,提示效果,“泡芙”效果,警告区域,折叠效果,旋转木马,输入提示)
上讲回顾:Bootstrap组件丰富同时具有良好可扩展性,能够很好地应用在生产环境.这些组件包括按钮(Button),导航(Navigation),缩略图( thumbnails),提醒(Alert) ...
- 21个很棒的jQuery分页插件下载
分页是指将一个大内容划分为各种不同的页面,因此网站的分页是一个很重要的部分,必须让内容有组织性和易于访问.分页有各两种不同的方式,手动跟自动.最受欢迎简单和广泛的方法是jQuery插件.下面我们收集了 ...
随机推荐
- Spring-security配置代码
@Configuration public static class WebSecurityConfigurer extends WebSecurityConfigurerAdapter{ @Over ...
- NodeJs学习记录(四)初学阶段关于app.js里的一些重要配置
app.set('views', path.join(__dirname, 'views')); 以上代码用于配置页面文件(例如 .ejs 文件)的根目录, 设置之后 访问 ./index 则等同于访 ...
- Objective-C设计模式——中介者Mediator(对象去耦)
中介者模式 中介者模式很好的诠释了迪米特法则,任意两个不相关的对象之间如果需要关联,那么需要通过第三个类来进行.中介者就是把一组对象进行封装,屏蔽了类之间的交互细节,使不同的类直接不需要持有对方引用也 ...
- 字符编码方式ASCII、Unicode、UTF-8
一.ASCII 1.介绍 即American Standard Code for Information Interchange(美国信息交换标准代码),是基于拉丁字母的,主要用于显示现代英语和其他西 ...
- 8月中旬之后的学习计划 --- react
这段时间快活了,放纵了,玩hi了,接下来该好好的学习新知识了. 鉴于目前业界比较火的前端js框架有react.vue,决定先从react开始学习.之前有简单的接触过它的一些基本的语法知识,这次准备全面 ...
- 常用Linux命令(长期更新)
有些命令如果不常用,老是记不住,每每用到总还要去查,特此将一些命令记录在此: (0)按指定时间删除文件 find target_dir -type f -mtime +3 -exec rm {} \; ...
- 【转载】jxl的使用总结(java操作excel)
jxl.jar是通过java操作excel表格的工具类库: 链接:https://pan.baidu.com/s/1AAT_eA_Q47zFeQohap6eQg 提取码:777b 1:通过模拟实现创建 ...
- AWK简单使用方法
1. 命令格式 gawk [OPTIONS] 'program' FILES.... program:'PATTERN{ACTION}' 一条awk命令中,PATTERN和ACTION,至少存在一个才 ...
- vue-cli 3.x 配置多环境
思路:新建一个 process.env 变量. 把 webpack 配置放到 vue.config.js 里面. 如果根目录下没有该文件,新建.配置参考:https://cli.vuejs.org/z ...
- 虚拟机上CentOS-6.9-x86_64系统安装教程
最近想学学Linux系统如何使用,于是想用VM安装虚拟机学习一下. linux系统比较多,我这里用的是CentOS-6.9-x86_64 一.下载系统 下载地址:https://www.centos. ...