/*iframe弹出层,width和height支持百分比字符*/ var ui = {}; ui.dialog = function (params) { var maxmin = false; var width = params.width; if (typeof (width) == "undefined") { width = "100%"; } var height = params.height; if (typeof (height) == "undefined") { height = "100%"; } if (width == "100%") { maxmin = false; } var defaultoption = { type:"iframe", title: "标题", shadeclose: true, target: "self", url:"", content: "", callback: "", cancelcallback:"" }; params = extend(defaultoption, params); var target = params.target; var containerid = "uidialogcontainer", titlebarid ="uidialogtitlebar", btnconfirmid = "uidialogconfirmbtn", btncancelid = "uidialogcancelbtn", btnclosebtnid = "uidialogclosebtn"; var alerticon = { alert: ' ', confirm: ' ' }; var $container; //创建容器 function createcontainer() { var $document = document; $container = $document.getelementbyid(containerid); if ($container == null) { $container = $document.createelement("div"); $container.setattribute("id", containerid); $container.setattribute("class", "el-dialog__wrapper el-dialog__" + params.type); $container.setattribute("style", "background: rgba(0, 0, 0,0.1);z-index: 2038;height:100%;overflow:hidden"); var $body = $document.getelementsbytagname("body")[0]; $body.insertbefore($container, ($body.children)[0]); } return $container; } function closedialog() { $container.style.display = "none"; $container.innerhtml = "" } function createdialog() { $container = createcontainer(); var winsize = clientsize(); var winheight = winsize.height; if (height.indexof("%") > 0) { height = parseint((winheight * parseint(height.replace("%", "")) / 100)); } else { height = parseint(height.replace(/[^0-9]/ig, "")); } var margintop = parseint(winheight / 2) - parseint(height / 2); if (margintop <= 0) { margintop = 0; } $container.style.display = "block"; var dialog= '