( function() {
var ua = navigator.userAgent.toLowerCase();
var is = (ua.match(/\b(chrome|opera|safari|msie|firefox)\b/) || [ '',
'mozilla' ])[1];
var r = '(?:' + is + '|version)[\\/: ]([\\d.]+)';
var v = (ua.match(new RegExp(r)) || [])[1];
jQuery.browser.is = is;
jQuery.browser.ver = v;
jQuery.browser[is] = true; })(); ( function(jQuery) { /*
*
* jQuery Plugin - Messager
*
* Author: corrie Mail: corrie@sina.com Homepage: www.corrie.net.cn
*
* Copyright (c) 2008 corrie.net.cn
*
* @license http://www.gnu.org/licenses/gpl.html [GNU General Public
* License]
*
*
*
* $Date: 2008-12-26
*
* $Vesion: 1.5 @ how to use and example: Please Open index.html
*
*/ this.version = '@1.5';
this.layer = {
'width' :200,
'height' :100
};
this.title = '信息提示';
this.time = 4000;
this.anims = {
'type' :'slide',
'speed' :600
};
this.timer1 = null;
this.inits = function(title, text) { if ($("#message").is("div")) {
return;
}
$(document.body)
.prepend(
'<div id="message" style="border:#b9c9ef 1px solid;z-index:100;width:'
+ this.layer.width
+ 'px;height:'
+ this.layer.height
+ 'px;position:absolute; display:none;background:#cfdef4; bottom:0; right:0; overflow:hidden;"><div style="border:1px solid #fff;border-bottom:none;width:100%;height:25px;font-size:12px;overflow:hidden;color:#1f336b;"><span id="message_close" style="float:right;padding:5px 0 5px 0;width:16px;line-height:auto;color:red;font-size:12px;font-weight:bold;text-align:center;cursor:pointer;overflow:hidden;">×</span><div style="padding:5px 0 5px 5px;width:100px;line-height:18px;text-align:left;overflow:hidden;">'
+ title
+ '</div><div style="clear:both;"></div></div> <div style="padding-bottom:5px;border:1px solid #fff;border-top:none;width:100%;height:auto;font-size:12px;"><div id="message_content" style="margin:0 5px 0 5px;border:#b9c9ef 1px solid;padding:10px 0 10px 5px;font-size:12px;width:'
+ (this.layer.width - 17)
+ 'px;height:'
+ (this.layer.height - 50)
+ 'px;color:#1f336b;text-align:left;overflow:hidden;">'
+ text + '</div></div></div>'); $("#message_close").click( function() {
setTimeout('this.close()', 1);
});
$("#message").hover( function() {
clearTimeout(timer1);
timer1 = null;
}, function() {
if (time > 0)
timer1 = setTimeout('this.close()', time);
}); $(window).scroll(
function() {
var bottomHeight = "-"+document.documentElement.scrollTop;
$("#message").css("bottom", bottomHeight + "px");
}); }; this.show = function(title, text, time) {
if ($("#message").is("div")) {
return;
}
if (title == 0 || !title)
title = this.title;
this.inits(title, text);
if (time >= 0)
this.time = time;
switch (this.anims.type) {
case 'slide':
$("#message").slideDown(this.anims.speed);
break;
case 'fade':
$("#message").fadeIn(this.anims.speed);
break;
case 'show':
$("#message").show(this.anims.speed);
break;
default:
$("#message").slideDown(this.anims.speed);
break;
}
var bottomHeight = "-"+document.documentElement.scrollTop;
$("#message").css("bottom", bottomHeight + "px"); if ($.browser.is == 'chrome') {
setTimeout( function() {
$("#message").remove();
this.inits(title, text);
$("#message").css("display", "block");
}, this.anims.speed - (this.anims.speed / 5));
}
this.rmmessage(this.time);
}; this.lays = function(width, height) { if ($("#message").is("div")) {
return;
}
if (width != 0 && width)
this.layer.width = width;
if (height != 0 && height)
this.layer.height = height;
} this.anim = function(type, speed) {
if ($("#message").is("div")) {
return;
}
if (type != 0 && type)
this.anims.type = type;
if (speed != 0 && speed) {
switch (speed) {
case 'slow':
;
break;
case 'fast':
this.anims.speed = 200;
break;
case 'normal':
this.anims.speed = 400;
break;
default:
this.anims.speed = speed;
}
}
} this.rmmessage = function(time) {
if (time > 0) {
timer1 = setTimeout('this.close()', time);
}
};
this.close = function() {
switch (this.anims.type) {
case 'slide':
$("#message").slideUp(this.anims.speed);
break;
case 'fade':
$("#message").fadeOut(this.anims.speed);
break;
case 'show':
$("#message").hide(this.anims.speed);
break;
default:
$("#message").slideUp(this.anims.speed);
break;
}
;
setTimeout('$("#message").remove();', this.anims.speed);
this.original();
} this.original = function() {
this.layer = {
'width' :200,
'height' :100
};
this.title = '信息提示';
this.time = 4000;
this.anims = {
'type' :'slide',
'speed' :600
};
};
jQuery.messager = this;
return jQuery;
})(jQuery);

jquery-模仿qq提示消息的更多相关文章

  1. 【WP8】仿QQ提示消息

    WP版的QQ提示消息的时候从顶部滑入,3秒后从顶部滑出,本文模仿该效果实现一个MessageToastManager类用于显示提示消息 思路很简单,就是动画而已,支持配置颜色和回掉 // ****** ...

  2. jQuery动态提示消息框效果

    效果预览:http://keleyi.com/keleyi/phtml/jqtexiao/2.htm 原文:http://keleyi.com/a/bjac/hxv86dyi.htm <!DOC ...

  3. jQuery实现鼠标移到元素上动态提示消息框效果

    当光标移动到某些元素上时,会弹出像tips的提示框,这种效果想必大家都有见到过吧,下面有个不错的示例,大家可以感受下 当光标移动到某些元素上时,会弹出像tips的提示框. 复制代码代码如下: < ...

  4. Jquery 网站保存信息提示消息实现,提示后自动消失

    现在的大多数网站都有校验,以及信息提示:为了给用户更好的体验可以不用alert提示消息,采用jQuery提示完消息,自动消失 css <style> #tip_message { z-in ...

  5. 一款基于jquery超炫的弹出层提示消息

    今天给大家带来一款基于jquery超炫的弹出层提示消息.这款实例页面初始时,一个go按钮.当单击go按钮时,提示强出层以动画形式出现.效果图如下: 在线预览   源码下载 实现的代码. html代码: ...

  6. jquery提示消息,简单通用

    jquery提示消息.简单通用 function showTips(txt,time,status) { var htmlCon = ''; if(txt != ''){ if(status != 0 ...

  7. jquery easyui 弹出消息框 (转载) jQuery EasyUI API 中文文档 - 消息框(Messager) http://www.cnblogs.com/hantianwei/archive/2012/03/19/2407113.html

    <html> <head> <!-- 导入easyui插件的js和css样式; --> <link rel="stylesheet" ty ...

  8. jquery easyui 弹出消息框

    <html> <head> <!-- 导入easyui插件的js和css样式; --> <link rel="stylesheet" ty ...

  9. 关于 使用python向qq好友发送消息(对爬虫的作用----当程序执行完毕或者报错无限给自己qq发送消息,直到关闭)

    以前看到网上一些小程序,在处理完事物后会自动发送qq消息,但是一直搞不懂是说明原理.也在网上找过一些python登陆qq发送消息的文字,但是都太复杂了.今天偶然看到一篇文章,是用python调用win ...

随机推荐

  1. MSIL实用指南-创建字段

    本篇讲解怎么创建字段,主要是在修饰符的创建上. 创建字段的方法是TypeBuilder.DefineField,传入字段名称.字段类型.字段修饰符等参数,返回一个FieldBuilder对象.先看这一 ...

  2. Spring服务定制

    问题总述 ​ 我们都知道如果使用Spring来进行bean管理的时候.如果同一个接口的实现类存在两个,直接使用@Autowired注解来实现bean注入,会在启动的时候报异常.我们通常的做法是使用@R ...

  3. linux编程基础汇总贴

    linux编程基础汇总贴http://newzol.cn/forum.php?mod=viewthread&tid=67&fromuid=3(出处: newzol) 1.管道 http ...

  4. IE浏览器清除缓存没用

    再想买更新JS和css文件之后, 使用 internet 里面的删除选项 发现样式和事件还是没用变 最终发现 需要 按 f12 找到这个清缓存才正常解决问题

  5. 理解 dispatch_get_specific

    这篇文章原来在用 Github Pages 搭建的博客上,现在决定重新用回博客园,所以把文章搬回来. dispatch_queue_set_specific用于给一个队列设置相关的上下文数据,disp ...

  6. Laravel框架中的make方法详解

    为什么网上已经有这么多的介绍Laravel的执行流程了,Laravel的容器详解了,Laravel的特性了,Laravel的启动过程了之类的文章,我还要来再分享呢? 因为,每个人的思维方式和方向是不一 ...

  7. 笔记:Struts 2.3.31 配置说明

    复制文件到站点的 WEB-INF\lib 目录,文件列表如下,黄色突出显示的是必须加入的核心包 struts2-core-2.3.31.jar:struts2 的核心库 xwork-core-2.3. ...

  8. 排序算法Java实现(快速排序)

    算法描述:对于一组给定的记录,通过一趟排序后,将原序列分为两部分,其中前一部分的所有记录均比后一部分的所有记录小,然后再依次对前后两部分的记录进行快速排序,递归该过程,直到序列中的所有记录均有序为止. ...

  9. Day3--------------目录文件的浏览、管理及维护

    1.pwd命令功能 2.cd命令功能 cd..      返回上一级 cd~ cd- 返回上一次的目录 cd 3.ls命令功能 ls -a ls -all ls -l 4.cp命令功能 cp -i 覆 ...

  10. jquery easyui+spring mnv 样式引不进,需要加载静态资源

    前台用的EasyUI,页面中引入了easyUI的js与css(引入路径正确),但是无论如何都显示不出来, 如下图: EasyUI的样式没有,看控制台:警告,找不到 21:26:25,643 WARN  ...