最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
jquery $.Dialog对话框示例代码
时间:2015-04-01 编辑:简简单单 来源:一聚教程网
效果图:
源代码:
//模态窗口插件
(function ($) {
$.Dialog = {
option: {
title: "dialog",
height: "300",
width: "500",
modal: true,
resizable: false,
external: true,
draggable: true,
closeandreturn:false
},
open: function (url, dlgid, options) {
var op = $.extend({}, $.Dialog.option, options);
dlgid += new Date().getTime(); // 加入当前时间戳,建立动态ID避免ID冲突
var tempDialog = document.getElementById(dlgid);
if (tempDialog != undefined && tempDialog != null) {
$dialog = $(tempDialog);
} else {
$body = $("body");
$div = $("
$div.attr("id", dlgid);
$body.append($div);
$dialog = $("#" + dlgid);
}
if (op.external) {
var iframeWidth = parseInt(op.width) - 10;
var iframeHeight = parseInt(op.height);
iframe = $("
-
上一个: jquery+css实现响应式菜单效果