jquery提示气泡
<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提示气泡的更多相关文章
- jquery $提示缺少对象$提示缺少对象
jquery $提示缺少对象 项目中存在不同版本的jquery,有1.4也有1.2, 之前运行项目不会报错 " $提示缺少对象 ",但是我的IE9重置之后就报错,从网上找了一大堆, ...
- jQuery提示组件toastr(取代alert)
给大家推荐一款jquery提示插件:toastr 它是一个可以取代alert的提示信息框,它在PC,移动设备上都有不错的UI效果. 具体使用方法如下: 1.首先在网页头站调用他需要的js和css文件. ...
- jquery提示sucess
这是学习笔记. 今天做东西的时候,想把体验做好,于是打算再ajax success字段中添加函数实现提示sucess. 用了jquery的fadeIn 跟fadeOut,再fadeIn的callbac ...
- jquery 提示语淡入效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- idea开启jquery提示及如何找到学习目标
idea开启jquery提示 根据这些library就知道该学习哪些技术了
- Eclipse通过Spket增加JQuery提示的方法
Eclipse通过Spket增加JQuery提示的方法 1.增加在线更新源:Help->Install New Software...->Add...->Name: "Sp ...
- Android 红色小圆球提示气泡 BadgeView
今天给大家分享两个实用有简单的一个小圆球提示气泡: BadgeView 参考地址: https://github.com/qstumn/BadgeView; 个人地址:http://git ...
- jquery提示消息,简单通用
jquery提示消息.简单通用 function showTips(txt,time,status) { var htmlCon = ''; if(txt != ''){ if(status != 0 ...
- DSAPI多功能组件编程应用-DS提示气泡
首先下载DSAPI.dll.并在项目中引用. 该功能包括在DSAPI1.0.1.1及更高版本号,DLL请到本人资源里查找. Private Sub Button1_Click(sender As Ob ...
随机推荐
- 国产CPU研究单位及现状
1.国产CPU主要研制单位 (1)高性能通用CPU(“大CPU”,主要应用于高性能计算及服务器等) 主要研发单位:中国科学院计算所.北大众志.国防科技大学.上海高性能集成电路设计中心 (2)安全适用计 ...
- Visual C++2010开发权威指南 中文高清PDF - VC.NET
第一部分 Visual C++ 2010开发与新特性第1章 Visual C++ 2010开发环境简介 11.1 Visual C++ 2010简介 11.2 Visual C++ 2010下 ...
- SQL存储过程和触发器
一. 存储过程 1. 有关概念 存储过程是由SQL语句及控制流语句组成的集合.调用一个存储过程,可以一次性地执行过程中的所有语句.从这一点来说,它类似于程序. 存储过程由用户建立,它作为数据库的一个 ...
- (转载)根据数据字典表定义的表结构,生成创建表的SQL语句
<来源网址:http://www.delphifans.com/infoview/Article_221.html>根据数据字典表定义的表结构,生成创建表的SQL语句 //1. 类名:T ...
- .NET基础之集合
集合可以说是数组的超集,集合可以维护对象数组,集合包含了更高级的功能.例如控制对其包含的对象的访问.搜索和排序等.数组是固定的,一旦我们创建好了数组,不能在现有数组的末尾添加新项,除非我们创建新的数组 ...
- bootstrap IE兼容
<meta name="viewport" content="width=device-width, initial-scale=1"> & ...
- 1006. Sign In and Sign Out
#include <stdio.h> #include <algorithm> #include <iostream> #include <string.h& ...
- Oracle访问数据的存取方法
1) 全表扫描(Full Table Scans, FTS) 为实现全表扫描,Oracle读取表中所有的行,并检查每一行是否满足语句的WHERE限制条件.Oracle顺序地读取分配给表的每个数据块,直 ...
- Sybase ASE安装过程报错,无法创建数据库设备[AM fork() failed]
今天同事要搭建一套测试环境,安装开发版的SYBASE ASE 15.03 Windows平台下的,发现安装过程中到了创建数据库设备的环节就开始报错了,报错信息如下: 03/24/14 09:31:44 ...
- 2017年iOS应用将强制使用HTTPS安全加密-b
6月14日,WWDC 2016苹果开发者大会上,苹果在讲解全新的iOS10中提到了数据安全这一方面,并且苹果宣布iOS应用将从2017年1月起启用名为App Transport Security的安全 ...