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插件.下面我们收集了 ...
随机推荐
- 基于Web的Kafka管理器工具之Kafka-manager启动时出现Exception in thread "main" java.lang.UnsupportedClassVersionError错误解决办法(图文详解)
不多说,直接上干货! 前期博客 基于Web的Kafka管理器工具之Kafka-manager的编译部署详细安装 (支持kafka0.8.0.9和0.10以后版本)(图文详解) 问题详情 我在Kaf ...
- RabbitMQ指南之五:主题交换器(Topic Exchange)
在上一章中,我们完善了我们的日志系统,用direct交换器替换了fanout交换器,使得我们可以有选择性地接收消息.尽管如此,仍然还有限制:不能基于多个标准进行路由.在我们的日志系统中,我们可能不仅希 ...
- MVC之模型绑定
1.前言 MVC全名是Model View Controller,是模型(model)-视图(view)-控制器(controller)的缩写,一种软件设计典范,用一种业务逻辑.数据.界面显示分离的方 ...
- 完成fcc作业2时思路
1.设置导航链接按钮栏时,不能用文档流,要用position:fixed;固定在窗口上方, 其他普通流盒子按上下顺序就用position:relative:后面发现导航栏被普通流盒子挡在了下面,就设置 ...
- 联想 S5 Pro(L78041)免解锁BL 免rec 保留数据 ROOT Magisk Xposed 救砖 ZUI 5.0.123
>>>重点介绍<<< 第一:本刷机包可卡刷可线刷,刷机包比较大的原因是采用同时兼容卡刷和线刷的格式,所以比较大第二:[卡刷方法]卡刷不要解压刷机包,直接传入手机后用 ...
- ElasticSearch学习笔记--安装
1.安装ElasticSearch https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-index_.html 这 ...
- (转) 淘淘商城系列——Redis五种数据类型介绍
http://blog.csdn.net/yerenyuan_pku/article/details/72855562 Redis支持五种数据类型:string(字符串),hash(哈希),list( ...
- 使用python获得N个区分度较高的RGB颜色值
获得任意N个区分度最高的RGB颜色值是一个经典的问题,之前在做一些可视化的东西时需要解决这个问题.首先去网上找了一些方法,未果,于是想自己来搞,心里的想法是,先给出一个距离函数用来度量两个RGB颜色值 ...
- Jmeter之JDBC请求参数化(二)
二.上面已经讲了一些基本的配置,和简单的jdbc请求,下面来看下具体的如何将查询语句参数化. 参数化这里有几种方法,foreach,计数器,csv等,这里介绍几种方法.
- chr()返回值是当前整数对应的 ASCII 字符。
#chr() 用一个范围在 range(256)内的(就是0-255)整数作参数,返回一个对应的字符.#返回值是当前整数对应的 ASCII 字符.1 import random input_m =10 ...