原文发布时间为:2009-04-23 —— 来源于本人的百度文章 [由搬家工具导入]

<html><script type="text/javascript">
function enableTooltips(id){
var links,i,h;
if(!document.getElementById || !document.getElementsByTagName) return;
h=document.createElement("span");
h.id="btc";
h.setAttribute("id","btc");
h.style.position="absolute";
document.getElementsByTagName("body")[0].appendChild(h);
if(id==null) links=document.getElementsByTagName("a");
else links=document.getElementById(id).getElementsByTagName("a");
for(i=0;i<links.length;i++){
Prepare(links[i]);
}
}
function Prepare(el){
var tooltip,t,b,s,l;
t=el.getAttribute("message");
if(t==null || t.length==0) return ;
el.removeAttribute("message");
tooltip=CreateEl("span","tooltip");
s=CreateEl("span","top");
//s.appendChild(document.createTextNode(t)); 改动
s.innerHTML = t;
tooltip.appendChild(s);
//b=CreateEl("b","bottom");
l=el.getAttribute("href");
if(l.length>30) l=l.substr(0,27)+"...";
//b.appendChild(document.createTextNode(l));
//tooltip.appendChild(b);
setOpacity(tooltip);
el.tooltip=tooltip;
el.onmouseover=showTooltip;
el.onmouseout=hideTooltip;
el.onmousemove=Locate;
}
function showTooltip(e){
document.getElementById("btc").appendChild(this.tooltip);
Locate(e);
}
function hideTooltip(e){
var d=document.getElementById("btc");
if(d.childNodes.length>0) d.removeChild(d.firstChild);
}
function setOpacity(el){
el.style.filter="alpha(opacity:95)";
el.style.KHTMLOpacity="0.95";
el.style.MozOpacity="0.95";
el.style.opacity="0.95";
}
function CreateEl(t,c){
var x=document.createElement(t);
x.className=c;
x.style.display="block";
return(x);
}
function Locate(e){
var posx=0,posy=0;
if(e==null) e=window.event;
if(e.pageX || e.pageY){
posx=e.pageX; posy=e.pageY;
}
else if(e.clientX || e.clientY){
if(document.documentElement.scrollTop){
posx=e.clientX+document.documentElement.scrollLeft;
posy=e.clientY+document.documentElement.scrollTop;
}
else{
posx=e.clientX+document.body.scrollLeft;
posy=e.clientY+document.body.scrollTop;
}
}
document.getElementById("btc").style.top=(posy+10)+"px";
document.getElementById("btc").style.left=(posx-20)+"px";
}
</script>
<script type="text/javascript">
window.onload=function(){enableTooltips()};
</script>
<style type="text/css">
body{font: 76%/1.5 Arial,sans-serif;background: #FFF;color: #333}
div, span, table{able-layout: fixed; word-wrap:break-word;}
div#container{width: 500px;margin:0 auto;}
h1{color: #3CA3FF;margin: 1em 0 0;letter-spacing: -2px}
p{margin: 0 0 1.7em}
a{color: #F60;font-weight:bold}
a:hover{color: #F00}
.tooltip{
width: 200px; color:#000;
font:lighter 11px/1.3 Arial,sans-serif;
text-decoration:none;text-align:center}
.tooltip{
width: 200px; color:#000;
font:lighter 11px/1.3 Arial,sans-serif;
text-decoration:none;text-align:center}
.tooltip span.top{
text-align:left;
text-indent:1em;
padding: 30px 8px;
background: url(/upload/20080817171524699.gif) no-repeat top;
}
.tooltip b.bottom{padding:3px 8px 15px;color: #548912;
background: url(/upload/20080817171524699.gif) no-repeat bottom;
}
</style>
<div id="container">

<a href="j111.html" title="我是title" message="这年头,和尚庙的香火越烧越旺,求保佑、求发财、求治病,乃至求升官和求升学的人一窝蜂涌进庙门,<a href='#'>简直要把门槛</a>踏烂.不过这些见菩萨就烧香磕头的信徒中,到底知道佛门是怎么回事的,恐怕不多。今天,在下也来道个究竟。">狼跋其胡,载踬其尾。公孙硕肤,赤舄几几。
找到彻底解脱的办法就是一个死字,</a>
</div>
</html>

javascript提示框,随着鼠标移动的更多相关文章

  1. EasyUI 学习(1)-Tooltip(提示框)

    一.创建组件 Tooltip不依赖其他组件 1.使用class加载 <a href="#" class="easyui-tooltip" title=&q ...

  2. jQuery Easy UI Tooptip(提示框)组件

    我们都知道DOM节点的title属性.Tooptip组件就是比較强大的title,它能够自由的设置自己的样式.位置以及有自己相关的触发事件. 演示样例: <!DOCTYPE html> & ...

  3. jQuery EasyUI 教程-Tooltip(提示框)

    <!DOCTYPE html> <html> <head> <title>jQuery Easy UI</title> <meta c ...

  4. echarts标准饼图解读(一)——提示框(tooltip)配置

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. 【Unity笔记】提示框ToolTips大小自适应,及其闪烁的问题

    需求:制作了一个提示框,当鼠标移入背包格子内,显示提示框,且提示框位置跟随鼠标移动.当鼠标移出背包格子,隐藏提示框. 制作提示框ToolTips 因为提示框的大小要求随着显示的文本内容长度而自动大小适 ...

  6. EasyUI-Tooltip(提示框)学习

    引子: if($("#BLUETOOTH_a")){ $("#BLUETOOTH_a").tooltip({ position: 'right', conten ...

  7. 第一百九十六节,jQuery EasyUI,Tooltip(提示框)组件

    jQuery EasyUI,Tooltip(提示框)组件 学习要点: 1.加载方式 2.属性列表 3.事件列表 4.方法列表 本节课重点了解 EasyUI 中 Tooltip(提示框)组件的使用方法, ...

  8. EasyUI系列学习(六)-Tooltip(提示框)

    一.创建组件 0.Tooltip不依赖其他组件 1.使用class加载 <a href="#" class="easyui-tooltip" title= ...

  9. tooltip(提示框)组件

    一.class加载方式 <span id="pos" class="easyui-tooltip" title="这是提示内容"> ...

随机推荐

  1. ajaxfileuplod 上传文件 essyui laoding 效果,防止重复上传文件

    //放于上传前 function ajaxLoading(){ $("<div class=\"datagrid-mask\"></div>&qu ...

  2. java的模运算

    在学习某个加密算法的时候留意到模运算,仔细查了资料后才注意到Java中的 % 其实是取余而不是取模,但是百度的时候找到的很多文章都把Java的 % 直接当成取模来用了,为了少踩坑所以自己整理了一下写了 ...

  3. 老男孩Python全栈第2期+课件笔记【高清完整92天整套视频教程】

    点击了解更多Python课程>>> 老男孩Python全栈第2期+课件笔记[高清完整92天整套视频教程] 课程目录 ├─day01-python 全栈开发-基础篇 │ 01 pyth ...

  4. 绘制字符串:imagestring()

    <?php //1. 绘制图像资源(创建一个画布) $image = imagecreatetruecolor(500, 300); //2. 先分配一个绿色 $green = imagecol ...

  5. uncompressing linux .................................................后没反应解决办法

    编译kernel是的no machine record defined 错误,网上有一些解法,其实都是错误的,以讹传讹.不打算自己写,找到一篇还算靠谱的,转摘一下. 其根本原因是没有在 __proc_ ...

  6. 学习python第二天 流程判断

    while循环age_of_Jim = 56 count = 0 #开始计数while True: #循环代码 if count ==3:#如果次数=3 break#退出 guess_age = in ...

  7. 修改python新建文件时的模板

  8. POJ 2771 Guardian of Decency (二分图最大点独立集)

    Guardian of Decency Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 6133   Accepted: 25 ...

  9. Redis实现之字典

    字典 字典,又称为符号表(symbol table).关联数组(associative array)或映射(map),是一种用于保存键值对(key-value pair)的抽象数据结构.在字典中,一个 ...

  10. Spring Boot 要点--启动类和热部署

    spring boot需要一个启动类 比如 package com.tianmaying; import org.springframework.boot.SpringApplication; imp ...