ZENG.msgbox.show("设置成功!", 4, 2000);

ZENG.msgbox.show("服务器繁忙,请稍后再试。", 1, 2000);

ZENG.msgbox.show("数据拉取失败", 5, 2000);

ZENG.msgbox.show(" 正在加载中,请稍后...", 6,8000);

有4种提示效果,根据参数配置。

/*
 1、消息
 4、正确
 5、错误
 6、加载
*/

@charset "utf-8";
/* CSS Document */.zeng_msgbox_layer,
.zeng_msgbox_layer .gtl_ico_succ,
.zeng_msgbox_layer .gtl_ico_fail,
.zeng_msgbox_layer .gtl_ico_hits,
.zeng_msgbox_layer .gtl_ico_clear,
.zeng_msgbox_layer .gtl_end{display:inline-block;height:54px;line-height:50px;font-weight:bold;font-size:14px;color:#000000;background-image:url("gb_tip_layer.png");background-repeat:no-repeat;}
.zeng_msgbox_layer_wrap{width:100%;position:fixed;_position:absolute;top:45%;left:0;text-align:center;z-index:65533;}
.zeng_msgbox_layer{background-position:0 -161px;background-repeat:repeat-x;padding:0 18px 0 9px;margin:0 auto;position:relative;}
.zeng_msgbox_layer .gtl_ico_succ{background-position:-6px 0;left:-45px;top:0;width:45px;position:absolute;}
.zeng_msgbox_layer .gtl_end{background-position:0 0;position:absolute;right:-6px;top:0;width:6px;}
.zeng_msgbox_layer .gtl_ico_fail{background-position:-6px -108px;position:absolute;left:-45px;top:0;width:45px;}
.zeng_msgbox_layer .gtl_ico_hits{background-position:-6px -54px;position:absolute;left:-45px;top:0;width:45px;}
.zeng_msgbox_layer .gtl_ico_clear{background-position:-6px 0;left:-5px;width:5px;position:absolute;top:0;}
.zeng_msgbox_layer img{float:left;margin:19px 10px 0 5px ;}

window.ZENG=window.ZENG || {};ZENG.dom = {getById: function(id) {return document.getElementById(id);},get: function(e) {return (typeof (e) == "string") ? document.getElementById(e) : e;},createElementIn: function(tagName, elem, insertFirst, attrs) {var _e = (elem = ZENG.dom.get(elem) || document.body).ownerDocument.createElement(tagName || "div"), k;if (typeof (attrs) == 'object') {for (k in attrs) {if (k == "class") {_e.className = attrs[k];} else if (k == "style") {_e.style.cssText = attrs[k];} else {_e[k] = attrs[k];}}}insertFirst ? elem.insertBefore(_e, elem.firstChild) : elem.appendChild(_e);return _e;},getStyle: function(el, property) {el = ZENG.dom.get(el);if (!el || el.nodeType == 9) {return null;}var w3cMode = document.defaultView && document.defaultView.getComputedStyle, computed = !w3cMode ? null : document.defaultView.getComputedStyle(el, ''), value = "";switch (property) {case "float":property = w3cMode ? "cssFloat" : "styleFloat";break;case "opacity":if (!w3cMode) {var val = 100;try {val = el.filters['DXImageTransform.Microsoft.Alpha'].opacity;} catch (e) {try {val = el.filters('alpha').opacity;} catch (e) {}}return val / 100;} else {return parseFloat((computed || el.style)[property]);}break;case "backgroundPositionX":if (w3cMode) {property = "backgroundPosition";return ((computed || el.style)[property]).split(" ")[0];}break;case "backgroundPositionY":if (w3cMode) {property = "backgroundPosition";return ((computed || el.style)[property]).split(" ")[1];}break;}if (w3cMode) {return (computed || el.style)[property];} else {return (el.currentStyle[property] || el.style[property]);}},setStyle: function(el, properties, value) {if (!(el = ZENG.dom.get(el)) || el.nodeType != 1) {return false;}var tmp, bRtn = true, w3cMode = (tmp = document.defaultView) && tmp.getComputedStyle, rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i;if (typeof (properties) == 'string') {tmp = properties;properties = {};properties[tmp] = value;}for (var prop in properties) {value = properties[prop];if (prop == 'float') {prop = w3cMode ? "cssFloat" : "styleFloat";} else if (prop == 'opacity') {if (!w3cMode) {prop = 'filter';value = value >= 1 ? '' : ('alpha(opacity=' + Math.round(value * 100) + ')');}} else if (prop == 'backgroundPositionX' || prop == 'backgroundPositionY') {tmp = prop.slice(-1) == 'X' ? 'Y' : 'X';if (w3cMode) {var v = ZENG.dom.getStyle(el, "backgroundPosition" + tmp);prop = 'backgroundPosition';typeof (value) == 'number' && (value = value + 'px');value = tmp == 'Y' ? (value + " " + (v || "top")) : ((v || 'left') + " " + value);}}if (typeof el.style[prop] != "undefined") {el.style[prop] = value + (typeof value === "number" && !rexclude.test(prop) ? 'px' : '');bRtn = bRtn && true;} else {bRtn = bRtn && false;}}return bRtn;},getScrollTop: function(doc) {var _doc = doc || document;return Math.max(_doc.documentElement.scrollTop, _doc.body.scrollTop);},getClientHeight: function(doc) {var _doc = doc || document;return _doc.compatMode == "CSS1Compat" ? _doc.documentElement.clientHeight : _doc.body.clientHeight;}
};ZENG.string = {RegExps: {trim: /^\s+|\s+$/g,ltrim: /^\s+/,rtrim: /\s+$/,nl2br: /\n/g,s2nb: /[\x20]{2}/g,URIencode: /[\x09\x0A\x0D\x20\x21-\x29\x2B\x2C\x2F\x3A-\x3F\x5B-\x5E\x60\x7B-\x7E]/g,escHTML: {re_amp: /&/g,re_lt: /</g,re_gt: />/g,re_apos: /\x27/g,re_quot: /\x22/g},escString: {bsls: /\\/g,sls: /\//g,nl: /\n/g,rt: /\r/g,tab: /\t/g},restXHTML: {re_amp: /&amp;/g,re_lt: /&lt;/g,re_gt: /&gt;/g,re_apos: /&(?:apos|#0?39);/g,re_quot: /&quot;/g},write: /\{(\d{1,2})(?:\:([xodQqb]))?\}/g,isURL: /^(?:ht|f)tp(?:s)?\:\/\/(?:[\w\-\.]+)\.\w+/i,cut: /[\x00-\xFF]/,getRealLen: {r0: /[^\x00-\xFF]/g,r1: /[\x00-\xFF]/g},format: /\{([\d\w\.]+)\}/g},commonReplace: function(s, p, r) {return s.replace(p, r);},format: function(str) {var args = Array.prototype.slice.call(arguments), v;str = String(args.shift());if (args.length == 1 && typeof (args[0]) == 'object') {args = args[0];}ZENG.string.RegExps.format.lastIndex = 0;return str.replace(ZENG.string.RegExps.format, function(m, n) {v = ZENG.object.route(args, n);return v === undefined ? m : v;});}};ZENG.object = {routeRE: /([\d\w_]+)/g,route: function(obj, path) {obj = obj || {};path = String(path);var r = ZENG.object.routeRE, m;r.lastIndex = 0;while ((m = r.exec(path)) !== null) {obj = obj[m[0]];if (obj === undefined || obj === null) {break;}}return obj;}};var ua = ZENG.userAgent = {}, agent = navigator.userAgent;
ua.ie = 9 - ((agent.indexOf('Trident/5.0') > -1) ? 0 : 1) - (window.XDomainRequest ? 0 : 1) - (window.XMLHttpRequest ? 0 : 1);if (typeof (ZENG.msgbox) == 'undefined') {ZENG.msgbox = {};
}
ZENG.msgbox._timer = null;
ZENG.msgbox.loadingAnimationPath = ZENG.msgbox.loadingAnimationPath || ("loading.gif");
ZENG.msgbox.show = function(msgHtml, type, timeout, opts) {if (typeof (opts) == 'number') {opts = {topPosition: opts};}opts = opts || {};var _s = ZENG.msgbox,template = '<span class="zeng_msgbox_layer" style="display:none;z-index:10000;" id="mode_tips_v2"><span class="gtl_ico_{type}"></span>{loadIcon}{msgHtml}<span class="gtl_end"></span></span>', loading = '<img src="' + (opts.customIcon || _s.loadingAnimationPath) + '" alt="" />', typeClass = [0, 0, 0, 0, "succ", "fail", "clear"], mBox, tips;_s._loadCss && _s._loadCss(opts.cssPath);mBox = ZENG.dom.get("q_Msgbox") || ZENG.dom.createElementIn("div", document.body, false, {className: "zeng_msgbox_layer_wrap"});mBox.id = "q_Msgbox";mBox.style.display = "";mBox.innerHTML = ZENG.string.format(template, {type: typeClass[type] || "hits",msgHtml: msgHtml || "",loadIcon: type == 6 ? loading : ""});_s._setPosition(mBox, timeout, opts.topPosition);
};
ZENG.msgbox._setPosition = function(tips, timeout, topPosition) {timeout = timeout || 5000;var _s = ZENG.msgbox, bt = ZENG.dom.getScrollTop(), ch = ZENG.dom.getClientHeight(), t = Math.floor(ch / 2) - 40;ZENG.dom.setStyle(tips, "top", ((document.compatMode == "BackCompat" || ZENG.userAgent.ie < 7) ? bt : 0) + ((typeof (topPosition) == "number") ? topPosition : t) + "px");clearTimeout(_s._timer);tips.firstChild.style.display = "";timeout && (_s._timer = setTimeout(_s.hide, timeout));
};
ZENG.msgbox.hide = function(timeout) {var _s = ZENG.msgbox;if (timeout) {clearTimeout(_s._timer);_s._timer = setTimeout(_s._hide, timeout);} else {_s._hide();}
};
ZENG.msgbox._hide = function() {var _mBox = ZENG.dom.get("q_Msgbox"), _s = ZENG.msgbox;clearTimeout(_s._timer);if (_mBox) {var _tips = _mBox.firstChild;ZENG.dom.setStyle(_mBox, "display", "none");}
}; 

转载于:https://www.cnblogs.com/jaday/p/4063882.html

ZENG msgbox仿qq提示相关推荐

  1. 自定义Dialog提示框高仿QQ浏览器版本更新提示框

    前言: 今天是5月7号,真的好久没有写博客了,时光匆匆,我总感觉自己忙忙碌碌似的,静想片刻确实是挺忙的,但是在繁忙当中却缺少了总结归纳,相信大家都知道总结归纳的重要性了,今天我要和大家分享我的自定义D ...

  2. 仿qq左滑删除listview_Java基于Swing和Netty仿QQ界面聊天小项目

    点击上方 好好学java ,选择 星标 公众号 重磅资讯.干货,第一时间送达 今日推荐:硬刚一周,3W字总结,一年的经验告诉你如何准备校招! 个人原创100W+访问量博客:点击前往,查看更多 来源:b ...

  3. Android ListView侧滑item,仿QQ删除效果

    尊重原创,转载请注明(http://blog.csdn.net/aoshiwenrou/article/details/42971193) 最近的项目需求有一条是要实现仿QQ的侧滑删除效果,网上搜到了 ...

  4. 高仿QQ即时聊天软件开发系列之三登录窗口用户选择下拉框

    上一篇高仿QQ即时聊天软件开发系列之二登录窗口界面写了一个大概的布局和原理 这一篇详细说下拉框的实现原理 先上最终效果图 一开始其实只是想给下拉框加一个placeholder效果,让下拉框在未选择未输 ...

  5. Android自定义View之仿QQ运动步数进度效果

    文章目录 前言 先看效果图 ![在这里插入图片描述](https://img-blog.csdnimg.cn/6e4ddec17933496ea4830fa08d8ffbe5.png?x-oss-pr ...

  6. 自定义View之仿QQ运动步数进度效果

    前言 今天接着上一篇来写关于自定义View方面的东西,我是近期在学习整理这方面的知识点,所以把相关的笔记都放到这个Android自定义View的专栏里了,方便自己下次忘记的时候能回来翻翻,今天的内容是 ...

  7. Java仿QQ聊天系统Eclipse+MySql实现

    qq聊天项目使用简介: 通过之前的java学习,写了一个仿QQ的聊天程序,主要实现的功能有注册.登录.好友列表.发送文字.图片.文件.表情. 项目环境配置 软件开发工具:eclipse 项目结构:客户 ...

  8. 【181029】FreeEIM 飞鸽传书仿QQ即时通讯软件VC++源代码

    FreeEIM 仿QQ功能的企业即时通讯软件VC++的源代码,最后更新于2010年8月份,完成数据库更改的任务.将聊天记录改用数据库形式,暂且使用Access. 本软件的窗口和功能都与QQ有点相似,可 ...

  9. 大多数人没听过的FreeEIM飞鸽传书,超炫酷的仿QQ,九零后都爱玩

    FreeEIM 仿QQ功能的企业即时通讯软件VC++的源代码,最近又更新了一次,完成数据库更改的任务.将聊天记录改用数据库形式,暂且使用Access. 本软件的窗口和功能都与QQ有点相似,可发送文件. ...

最新文章

  1. 元组Tuple、数组Array、映射Map
  2. datatable与SqlDataReader
  3. key设计 短信验证存redis_Redis存储Key的一种设计实现方式:模式匹配
  4. 【数据竞赛】长文本竞赛上分的三种策略。
  5. ZZULIOJ 1058: 求解不等式
  6. 2021年,作为算法工程师的你们会在CV业务上用Transformer吗?
  7. 使用xshell6连接linux提示 WARNING! The remote SSH server rejected X11 forwarding
  8. jdbc代码_Mysql Java 驱动代码阅读笔记及 JDBC 规范笔记
  9. [记录] web icon 字体
  10. jdk安装好了怎么使用_安装jdk怎么打开
  11. cad剖切线的快捷键_CAD快捷键记不住怎么办?顶级绘图员教你,从此不求人
  12. Python文本分析 jieba
  13. 微软「警告」员工不要在愚人节搞事情,为什么?
  14. HTML5期末考核大作业:华为官网 ( 2页带轮播图)
  15. centos7.3根目录空间扩展
  16. ERD Commander 2005 使用教程
  17. 这个夏天,飞到北纬18°去玩海——带着小样儿去三亚(二)
  18. uni-app map路线轨迹回放功能及turf.js实现缓冲区渲染(微信小程序)
  19. [精品教程,新老鸟必读]:极限装机、优化全攻略(新手优化教程)
  20. PDF格式的“在线阅读”和“下载”

热门文章

  1. pytorch创建datset
  2. OpenCV基本线条操作
  3. mysql sum 慢_故障分析 | MySQL 优化案例 - select count(*)
  4. 零基础入门CV赛事-Task1 赛题理解
  5. Python爬虫编程实践 Task03
  6. 研0必读!李航《统计学习方法》啃书指南
  7. 关于NLP相关技术全部在这里:预训练模型、信息抽取、文本生成、知识图谱、对话系统...
  8. 通过数据评估渠道用户质量的方法
  9. MySQL笔记 4月记
  10. 最佳String判断是否为空