/**
+-------------------------------------------------------------------
* jQuery hDialog - 多功能弹出层插件
+-------------------------------------------------------------------
* @version 2.0.4
* @author haibao
* github [https://github.com/hehaibao/hDialog]
* MIT
+-------------------------------------------------------------------
*/
(function(c) {
"function" === typeof define && define.amd ? define(["jquery"], c) : c(window.jQuery || window.Zepto)
})(function(c, v) {
var m = c(document),
n = c(window),
u = c("body"),
f, p = null,
d = {
op: {},
version: "2.0.4",
init: function(a) {
return this.each(function() {
f = c(this);
var b = null;
b = c.extend({}, {
title: "",
box: "#HBox",
boxBg: "#ffffff",
modalBg: "rgba(0,0,0,0.5)",
width: 300,
height: 270,
positions: "center",
effect: "zoomOut",
hideTime: 0,
modalHide: !0,
isOverlay: !0,
escHide: !0,
autoShow: !1,
autoHide: !1,
types: 1,
iframeSrc: "",
iframeId: "iframeHBox",
beforeShow: function() {},
afterHide: function() {}
}, a);
if(b.autoShow) d.op = b, d.open();
else f.off("click").on("click", function(a) {
d.op = b;
d.open()
});
b.autoHide && d.close()
})
},
open: function() {
d.checkBrowserVersion() && (this.op.modalBg = "#000000", alert("\u7cfb\u7edf\u68c0\u6d4b\u5230\u60a8\u6b63\u5728\u4f7f\u7528ie8\u4ee5\u4e0b\u5185\u6838\u7684\u6d4f\u89c8\u5668\uff0c\u4e0d\u80fd\u5b9e\u73b0\u5b8c\u7f8e\u4f53\u9a8c\uff0c\u8bf7\u53ca\u65f6\u66f4\u65b0\u6d4f\u89c8\u5668\u7248\u672c\uff01"));
var a = this.op,
b = "",
q = "",
r = "",
t = a.autoShow ? f : c(a.box);
var e = parseInt(a.width);
var g = parseInt(a.height);
var h = "" + parseInt(-(g / 2)) + "px 0 0 " + parseInt(-(e / 2)) + "px";
a.beforeShow && this.fire.call(this, a.beforeShow);
switch(a.positions) {
case "top":
var k = 0;
var l = "50%";
h = "0 0 0 " + parseInt(-(e / 2)) + "px";
break;
case "left":
k = l = h = 0;
break;
case "bottom":
k = parseInt(n.height() - g) + "px";
l = parseInt(n.width() - e) + "px";
h = 0;
break;
default:
k = l = "50%"
}
a.isOverlay && !c("#HOverlay").length && (q = "");
"" == a.title || c("#HTitle").length || (b = '
b += '×';
2 == a.types && "" != a.iframeSrc && (r = '');
u.stop().append(q).find(t).css({
backgroundColor: a.boxBg,
position: "fixed",
top: k,
left: l,
zIndex: 999999,
margin: h,
width: e,
height: g
}).removeAttr("class").addClass("animated " + f.attr("class")).prepend(b + r).show();
t.modalHide ? c("#HOverlay, #HCloseBtn") : c("#HCloseBtn").off("click").on("click", function() {
d.close()
});
0 != a.hideTime && (p = setTimeout(function() {
d.close()
}, parseInt(a.hideTime)));
a.escHide && m.off("keyup").on("keyup", function(a) {
a = a || window.event;
27 === (a.keyCode ? a.keyCode : a.which ? a.which : a.charCode) && d.close()
})
},
close: function() {
var a = this,
b = a.op,
d = c(b.box);
clearTimeout(p);
d.is(":visible") && (d.removeAttr("class").addClass("animated " +
b.effect), d.hasClass(b.effect) && setTimeout(function() {
d.removeAttr("style").hide()
}, 300), c("#HOverlay, #HTitle, #" + b.iframeId).remove(), setTimeout(function() {
b.afterHide && a.fire.call(a, b.afterHide)
}, 310))
},
fire: function(a, b) {
if(c.isFunction(a)) return a.call(this, b)
},
checkBrowserVersion: function() {
var a = navigator.userAgent.toLowerCase(),
b = !1; - 1 < a.indexOf("msie") && (a = a.match(/msie ([\d.]+)/)[1], b = 8 >= parseInt(a) ? !0 : !1);
return b
}
};
c.fn.hDialog = function(a) {
return d[a] ? d[a].apply(this, Array.prototype.slice.call(arguments,
1)) : "object" !== typeof a && a ? (c.error("Error! Method" + a + "does not exist on jQuery.hDialog\uff01"), this) : d.init.apply(this, arguments)
}
});
//浏览
$(function() {
//iframe
$('.btn-color').hDialog({
types: 2,
iframeSrc: 'second.html',
iframeId: 'iframeHBox',
width: 800,
height: 600
});
});
//编辑文件名
function OpenDiv( ) {
document.getElementById("hideId").value="传递的文件夹主键"
document.getElementById("div1").style.display = "block";
document.getElementById("open").style.display = "none";
}
/*
给div层中的关闭添加onclick事件:*/
function CloseDiv() {
document.getElementById("div1").style.display = "none";
document.getElementById("open").style.display = "block";
}