博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
弹出提示框,大面板
阅读量:5346 次
发布时间:2019-06-15

本文共 8957 字,大约阅读时间需要 29 分钟。

function openalert(txt, lisneter, parent,title) {    var p = parent || 'body';    var bg = $('
').appendTo(p); bg.css({ position: 'fixed', top: '0px', left: '0px', width: '100%', height: '100%', backgroundColor: "#000", opacity: 0 }); var rame = $('
').appendTo(p); var ramedraw = rame.draw("xy",".head_t"); if ($.browser.msie) { if ($.browser.version == 7){ rame.css({ width: '300px' }); } else if ($.browser.version == 6){ $w = $(window); var s = $w.scrollTop(); rame.css({ width: '300px', position: 'absolute',top:($w.height() - rame.height()) / 2+s }); bg.css({ position: 'absolute', height: $w.height(), width: $w.width(),top:s}); $w.scroll(function () { var s = $w.scrollTop(); var t = ($w.height() - rame.height()) / 2 + s; bg.css({ top: s }); rame.css({ top: t }); }); } } rame.find(".head_t a.close").click(function () { close(); if (lisneter && typeof (lisneter.onclose) === 'function') lisneter.onclose(); }); rame.find(".footer a.ok").click(function () { close(); if (lisneter && typeof (lisneter.onok) === 'function') lisneter.onok(); }); rame.find(".footer a.cancel").click(function () { close(); if (lisneter && typeof (lisneter.oncancel) === 'function') lisneter.oncancel(); }); rame.find(".footer a.agree").click(function () { close(); if (lisneter && typeof (lisneter.onagree) === 'function') lisneter.onagree(); }); rame.find(".footer a.refuse").click(function () { close(); if (lisneter && typeof (lisneter.onrefuse) === 'function') lisneter.onrefuse(); }); if (lisneter && typeof (lisneter.oncancel) === 'function') { rame.find(".footer a.cancel").css({display:'inline-block'}); } if (lisneter && typeof (lisneter.onok) === 'function') { rame.find(".footer a.ok").css({display:'inline-block'}); } if (lisneter && typeof (lisneter.onagree) === 'function') { rame.find(".footer a.agree").css({display:'inline-block'}); } if (lisneter && typeof (lisneter.onrefuse) === 'function') { rame.find(".footer a.refuse").css({display:'inline-block'}); } if (lisneter && lisneter.noicon) { rame.css({ background: "#fff" }); rame.find('.content').css({ marginLeft: '0px' }); } var close = function (b) { ramedraw.unload(); rame.animate({ opacity: 0 }, function () { rame.remove(); }); bg.animate({ opacity: 0 }, function () { bg.remove(); }); }; var w = rame.width(); var h = rame.height(); rame.css({ marginLeft: "-" + w / 2 + 'px', marginTop: '-' + (h / 2 + 30) + 'px' }); if(parent){ var $parent = $(parent) $parent.css({position:'relative'}); bg.css({width:'100%',height:'100%',top:0,left:0,position:'absolute'}); rame.css({position:'absolute'}); } bg.animate({ opacity: 0.4 }, 300); rame.fadeIn(); rame.close = close; return rame;}/*弹出一个大面板*/function openpanel(title, selector, lisneter) { var bg = $('
').appendTo("body"); bg.css({ position: 'fixed', top: '0px', left: '0px', width: '100%', height: '100%', backgroundColor: "#000", opacity: 0 }); var rame = $('
').appendTo("body"); //var rameobj = rame.draw("xy",".head_t"); rame[0].id = rame[0].id + selector.substr(1); var content = $(selector); var parent = content.parent(); if (lisneter.hasLoad) { rame.children('.content').css('background', 'url(/images/openloading.gif) no-repeat center center'); content.css('visibility', 'hidden'); } rame.children('.content').append(content[0]); if($.browser.msie){ if($.browser.version == 7||$.browser.version == 8){ rame.css({width:content.width()+60+'px'}); } else if($.browser.version == 6){ $("body").css({height:'100%',width:'100%'}); bg.css({position:'absolute'}); rame.css({position:'absolute'}); rame.css({width:content.width()+60+'px'}); } } rame.find(".head_t a.close").click(function(){ close(); if(lisneter && typeof(lisneter.onclose) === 'function') lisneter.onclose(); }); rame.find(".footer a.ok").click(function(){ close(); if(lisneter && typeof(lisneter.onok) === 'function') lisneter.onok(); }); rame.find(".footer a.cancel").click(function(){ close(); if(lisneter && typeof(lisneter.oncancel) === 'function') lisneter.oncancel(); }); rame.find(".footer a.agree").click(function(){ close(); if(lisneter && typeof(lisneter.onagree) === 'function') lisneter.onagree(); }); rame.find(".footer a.refuse").click(function(){ close(); if(lisneter && typeof(lisneter.onrefuse) === 'function') lisneter.onrefuse(); }); if(lisneter && typeof(lisneter.oncancel) === 'function'){ rame.find(".footer a.cancel").css({display:'inline-block'}); } if(lisneter && typeof(lisneter.onok) === 'function'){ rame.find(".footer a.ok").css({display:'inline-block'}); } if(lisneter && typeof(lisneter.onagree) === 'function'){ rame.find(".footer a.agree").css({display:'inline-block'}); } if(lisneter && typeof(lisneter.onrefuse) === 'function'){ rame.find(".footer a.refuse").css({display:'inline-block'}); } if(lisneter && lisneter.noicon){ rame.css({background:"#fff"}); rame.find('.content').css({marginLeft:'0px'}); } var close = function (f) { //rameobj.unload(); if (content.attr("iframe") && content.attr("iframe") != '') content.empty(); parent.append(content); win.unbind('resize', resbox); bg.remove(); rame.remove(); /* rame.animate({opacity:0},function(){ parent.append(content); rame.remove(); if(typeof(f) == 'function') f(); }); bg.animate({opacity:0},function(){ bg.remove(); }); */ } var win = $(window); if (content.attr("iframe") && content.attr("iframe") != '') { var frameHeight = content.attr('frameHeight'); var src = content.attr("iframe"); content.empty(); src = src.indexOf("?") > 0 ? src + "&t=" + new Date : src + "?t=" + new Date(); content.append('

 

转载于:https://www.cnblogs.com/wwqianduan/p/3494378.html

你可能感兴趣的文章
码农创业,6年80万,有梦想才可能有机会
查看>>
探索性测试及基本用例
查看>>
【转】自定义置顶TOP按钮
查看>>
C#抽象类、接口、虚函数和抽象函数
查看>>
Eclipse快捷键
查看>>
关于变量的引用(&)
查看>>
mysql权限
查看>>
软件项目与过程管理第七周作业
查看>>
获取数组最小值
查看>>
jquery清空textarea等输入框
查看>>
Nginx快速上手下篇
查看>>
线性表
查看>>
crawlSpider全站数据爬取
查看>>
iOS消息推送机制
查看>>
leetcode - Reverse Linked List II
查看>>
深入理解HashMap底层实现原理
查看>>
Session和Cookie
查看>>
python学习笔记:第20天 多继承、MRO C3算法
查看>>
开题报告范文
查看>>
AVD之PANIC: Could not open ***
查看>>