<link href="css/manhua_hoverTips.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="http://www.jq-school.com/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="js/manhua_hoverTips.js"></script>
<script type="text/javascript">
$(function () {
$("p").manhua_hoverTips(); //使用默认参数,所以不用调用最简洁(下面显示)
$("#btn").manhua_hoverTips({ position: "l" }); //改变了显示的位置参数(右边显示)
$("#tr").manhua_hoverTips({ position: "r" }); //改变了显示的位置参数(左边显示)
$("#tb").manhua_hoverTips({ position: "b" }); //改变了显示的位置参数(下面显示)
});
</script> <body>
<center>
<form id="form1" runat="server">
<div>
<p tips="哈哈 是我。。。。。">afdsafdsfasd</p>
<input id="btn" type="button" tips="我怎么了,怎么会???" value="button" />
<br />
<select id="tr" tips="是我。。。。。"><option></option>
</select>
<br />
<input id="tb" tips="你要说什么......." type="radio" />
</div>
</form>
</center>
</body>
body {
background: #f7f7f7;
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.docBubble {position:absolute;max-width:240px; text-align:left;text-align:left;z-index:; display:none;}
.docBubble a{ margin-left:;}
.docBubble .icon{ background:none;}
.docBubble .title a {text-decoration: none;}
.docBubble .tl,.docBubble .tr,.docBubble .bl,.docBubble .inner,.docBubble .triangle-t,.docBubble .triangle-b,.docBubble .close{ background-image:url(../images/manhua_bubbletips.png);_background-image:url(../images/manhua_bubbletips_ie6.png); }
.docBubble .tl{ float:left; background-position:-20px ; }
.docBubble .tr{ position:absolute;right:-12px; top:;width:12px; height:12px; background-position:% ; }
.docBubble .bl{ position:absolute;left:; bottom:-12px; width:12px; height:12px; background-position:-20px %; }
.docBubble .inner{ position: relative;left:12px; width:220px; margin:12px -12px ; max-width:220px; background-position:% %; padding: 12px 12px 2px; _padding-bottom:12px; }
.docBubble .triangle-t{ position:absolute; z-index:; top:-7px; width:15px; height:8px; overflow:hidden; }
.docBubble .triangle-b{ position:absolute; bottom:-18px; z-index:; width:15px; height:11px; overflow:hidden; background-position: -10px; }
.docBubble .triangle-l{ position:absolute; left:-10px; z-index:; top:15px; width:15px; height:18px; overflow:hidden; background:url(../images/manhua_bubbletips_l.png) no-repeat;_background-image:url(../images/manhua_bubbletips_l_ie6.png) no-repeat; }
.docBubble .triangle-r{ position:absolute; right:-19px; z-index:; top:15px; width:15px; height:18px; overflow:hidden; background:url(../images/manhua_bubbletips_r.png) no-repeat;_background-image:url(../images/manhua_bubbletips_r_ie6.png) no-repeat; }
.docBubble .triangle-t,.docBubble .triangle-b{ right:20px;}
.docBubble .close{ position:absolute; z-index:; top:10px; right:2px; width:9px; height:9px; text-indent:-99em; overflow:hidden; background-position: -25px; cursor:pointer;}
.docBubble .inner .icon{ float:left; padding: 2px ;}
.docBubble .inner .icon img{ margin-right:10px; }
.docBubble .inner .cont{ overflow:hidden; zoom:; line-height:20px;}
.docBubble .inner .title{ margin: 2px ; font-size:12px;font-weight:bold;}
.docBubble .inner .lk-btn{ text-align:right;}

css(manhua_hoverTips.css)

/***
* 漫画原创鼠标悬浮气泡提示Jquery插件
* 编写时间:2012年11月14号
* version:manhua_hoverTips.js
***/
$(function() {
$.fn.manhua_hoverTips = function(options) {
var defaults = {
position : "t", //箭头指向上(t)、箭头指向下(b)、箭头指向左(l)、箭头指向右(r)
value : //小箭头偏离左边和上边的位置 };
var options = $.extend(defaults,options); var bid = parseInt(Math.random()*);
var $this = $(this);
$("body").prepend('<div class="docBubble" id="btip'+bid+'"><i class="triangle-'+options.position+'"></i><div class="tl"><div class="inner"><div class="cont"></div></div></div><div class="tr"></div><div class="bl"></div></div>');
var $btip = $("#btip"+bid);
var $btipClose = $("#btipc"+bid);
var offset,h ,w ;
var timer;
$this.die().live("mousemove",function(){
clearInterval(timer);
offset = $(this).offset();
h = $(this).height();
w = $(this).width();
$(".cont").html($(this).attr("tips")); switch(options.position){
case "t" ://当它是上面的时候
$(".triangle-t").css('left',options.value);
$btip.css({ "left":offset.left , "top":offset.top+h+ }).show();
break;
case "b" ://当它是下面的时候
$(".triangle-b").css('left',options.value);
$btip.css({ "left":offset.left , "top":offset.top-h--$btip.height() }).show();
break;
case "l" ://当它是左边的时候
$(".triangle-l").css('top',options.value);
$btip.css({ "left":offset.left+w+ , "top":offset.top+h/--options.value }).show();
break;
case "r" ://当它是右边的时候
$(".triangle-r").css('top',options.value);
$btip.css({ "left":offset.left--$btip.width() , "top":offset.top+h/--options.value }).show();
break;
} });
$this.live("mouseout",function(){
timer = setInterval(function (){
$btip.hide();
}, );
}); $btip.live("mousemove",function(){
clearInterval(window.timer);
$btip.show();
});
$btip.live("mouseout",function(){
$btip.hide();
});
$btipClose.live("click",function(e){
$btip.hide();
});
}
});

manhua_hoverTips.js

jquery提示气泡的更多相关文章

  1. jquery $提示缺少对象$提示缺少对象

    jquery $提示缺少对象 项目中存在不同版本的jquery,有1.4也有1.2, 之前运行项目不会报错 " $提示缺少对象 ",但是我的IE9重置之后就报错,从网上找了一大堆, ...

  2. jQuery提示组件toastr(取代alert)

    给大家推荐一款jquery提示插件:toastr 它是一个可以取代alert的提示信息框,它在PC,移动设备上都有不错的UI效果. 具体使用方法如下: 1.首先在网页头站调用他需要的js和css文件. ...

  3. jquery提示sucess

    这是学习笔记. 今天做东西的时候,想把体验做好,于是打算再ajax success字段中添加函数实现提示sucess. 用了jquery的fadeIn 跟fadeOut,再fadeIn的callbac ...

  4. jquery 提示语淡入效果

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  5. idea开启jquery提示及如何找到学习目标

    idea开启jquery提示 根据这些library就知道该学习哪些技术了

  6. Eclipse通过Spket增加JQuery提示的方法

    Eclipse通过Spket增加JQuery提示的方法 1.增加在线更新源:Help->Install New Software...->Add...->Name: "Sp ...

  7. Android 红色小圆球提示气泡 BadgeView

    今天给大家分享两个实用有简单的一个小圆球提示气泡: BadgeView 参考地址: https://github.com/qstumn/BadgeView;       个人地址:http://git ...

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

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

  9. DSAPI多功能组件编程应用-DS提示气泡

    首先下载DSAPI.dll.并在项目中引用. 该功能包括在DSAPI1.0.1.1及更高版本号,DLL请到本人资源里查找. Private Sub Button1_Click(sender As Ob ...

随机推荐

  1. php数组去重的函数代码

    php中数组去重的小例子.  代码如下: <?php   /** * 数组去重复的小函数 * by www.jbxue.com */     function assoc_unique($arr ...

  2. phpcms v9修改栏目描述的多行文本为编辑器方法

    phpcms v9在添加栏目的时候,栏目描述为多行文本,无法满足有图片,以及格式的修改调整,那么仿站网今天告诉大家如何将他改为编辑器,方法如下 找到phpcms/moudles/admin/templ ...

  3. mvc 之 @Html.DropDownList

    Dictionary<string, string> myDic = new Dictionary<string, string>(); myDic.Add(System.DB ...

  4. python编程语言缩进格式

    python的缩进格式是python语法中最特别的一点,很多已经习惯了其他语言的朋友再去学python的话,开始会觉的不太 习惯. 怎么看怎么都觉的别扭,也有一些朋友因为这个特别的格式与python失 ...

  5. Nginx upstream的5种权重分配方式

    .轮询(默认) 每个请求按时间顺序逐一分配到不同的后端服务器,后端服务器down掉,能自动剔除 .weight 指定轮询几率,weight和访问比率成正比,用于后端服务器性能不均的情况. upstre ...

  6. 八、mysql视图、存储过程、函数以及时间调度器

    .create or replace view emp_view as select * from t4 ;给t4表创建一个名为emp_view的视图 .drop view emp_view 删除视图 ...

  7. asp 回发的时候样式变化

    在一个按钮确定后弹出一个提示框,在提示框没有关闭时有时会发现页面的样式发生变化. 解决方法: 在DIV外增加,<table><tr><td align="lef ...

  8. Keil V5.1x命令“Build Target”重新编译所有文件

    网上的解决办法有多种,但不知道哪一种能对症,以下是我的解决方法:

  9. Head First设计模式悟道

    暂时包括 策略模式,观察者,装饰模式,工厂模式,抽象工厂模式,后续会继续补充中,纯属个人总结用,不喜勿喷, 源代码见: 传送门 public class NYPizzaIngredientFactor ...

  10. UIImagePickerController拍照与摄像(转)

    转载自:http://blog.sina.com.cn/s/blog_68edaff101019ppe.html (2012-11-23 14:38:40) 标签: ios iphone 拍照 摄像 ...