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插件.下面我们收集了 ...
随机推荐
- 274 H-Index H指数
给定一位研究者的论文被引用次数的数组(被引用次数是非负整数).写一个方法计算出研究者的H指数.H-index定义: “一位科学家有指数 h 是指他(她)的 N 篇论文中至多有 h 篇论文,分别被引用了 ...
- Jquery 全选、反选问题的记录
<div id="list"> <ul id="choseList" > <li><input type=" ...
- spring中配置数据源
spring中配置数据源的几种常见方式: #mysql 数据库配置(jdbc.properties) jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.u ...
- dapper未将对象引用设置到对象的实例
现象是这样的dapper在reader.Read<T>()方法时报:未将对象引用设置到对象的实例 解决:实体类里属性类型与数据库表字段类型不匹配 我用的mysql varchar(50)保 ...
- js让页面逐渐变透明,直到消失
在gitHub闲逛的时候,无意间发现了些好玩的代码,一个歪果仁写的,这里我做了些修改和优化,gitHub链接已经忘了,是一段恶搞的js代码,假如你的顾客或者老板拖欠你工资,那你就可以让项目页面在浏览器 ...
- creator游戏开发基本语法
写的比较杂乱,类似随笔,随时可能往里面添加修改给lable文本赋值: this.ScoreNumber.getComponent(cc.Label).string = GAME_DATE.MMscor ...
- position的简单用法实例 ----- 方框里图片放对应的角标
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <hea ...
- Day 14B 网络应用开发
网络应用开发 发送电子邮件 在即时通信软件如此发达的今天,电子邮件仍然是互联网上使用最为广泛的应用之一,公司向应聘者发出录用通知.网站向用户发送一个激活账号的链接.银行向客户推广它们的理财产品等几乎都 ...
- Linux常用命令——帮助命令
1.帮助命令:man man 命令 获取指定命令的帮助 [dmtsai@study ~]$ man date DATE (1) User Commands DATE(1) #注意这个(1),代表的是m ...
- HTML元素以及HTML元素的分类
HTML元素以及HTML元素的分类 html标签又叫做html元素,它分为块级元素和内联元素(也可以叫做行内元素),都是html规范中的概念 块级元素 含义:块级元素是指本身属性为display:bl ...