title及alt提示特效
- <html>
- <head>
- <title>title及alt提示特效</title>
- <style type="text/css">
- body{font-size:12px;color:#000000}
- td{font-size:12px;color:#000000}
- a:link{font-size:12px;color:#000000}
- </style>
- <script language="javascript">
- var pltsPop=null;
- var pltsoffsetX = 12; // 弹出窗口位于鼠标左侧或者右侧的距离;3-12 合适
- var pltsoffsetY = 15; // 弹出窗口位于鼠标下方的距离;3-12 合适
- var pltsTitle="";
- document.write('<div id=pltsTipLayer style="display: none;position: absolute; z-index:10001"></div>');
- function pltsinits()
- {
- document.onmouseover = plts;
- document.onmousemove = moveToMouseLoc;
- }
- function plts()
- { var o=event.srcElement;
- if(o.alt!=null && o.alt!=""){oo.dypop=o.alt;o.alt=""};
- if(o.title!=null && o.title!=""){oo.dypop=o.title;o.title=""};
- pltsPop=o.dypop;
- if(pltsPop!=null && pltsPop!="" && typeof(pltsPop)!="undefined")
- {
- pltsTipLayer.style.left=-1000;
- pltsTipLayer.style.display='';
- var Msg=pltsPop.replace(/\n/g,"<br>");
- MsgMsg=Msg.replace(/\0x13/g,"<br>");
- var re=/\{(.[^\{]*)\}/ig;
- if(!re.test(Msg))pltsTitle="『水木设计联盟』";
- else{
- re=/\{(.[^\{]*)\}(.*)/ig;
- pltsTitle=Msg.replace(re,"$1")+" ";
- re=/\{(.[^\{]*)\}/ig;
- MsgMsg=Msg.replace(re,"");
- MsgMsg=Msg.replace("<br>","");}
- var content =
- '<table style="FILTER:alpha(opacity=90);border: 1px solid #cccccc" id="toolTipTalbe" cellspacing="1" cellpadding="0"><tr><td width="100%"><table bgcolor="#ffffff" cellspacing="0" cellpadding="0">'+
- '<tr id="pltsPoptop"><td height="20" bgcolor="#0094bb"><font color="#ffffff"><b><p id="topleft" align="left">↖'+pltsTitle+'</p><p id="topright" align="right" style="display:none">'+pltsTitle+'↗</font></b></font></td></tr>'+
- '<tr><td "+attr+" style="padding-left:10px;padding-right:10px;padding-top: 8px;padding-bottom:6px;line-height:140%">'+Msg+'</td></tr>'+
- '<tr id="pltsPopbot" style="display:none"><td height="20" bgcolor="#0094bb"><font color="#ffffff"><b><p id="botleft" align="left">↙'+pltsTitle+'</p><p id="botright" align="right" style="display:none">'+pltsTitle+'↘</font></b></font></td></tr>'+
- '</table></td></tr></table>';
- pltsTipLayer.innerHTML=content;
- toolTipTalbe.style.width=Math.min(pltsTipLayer.clientWidth,document.body.clientWidth/2.2);
- moveToMouseLoc();
- return true;
- }
- else
- {
- pltsTipLayer.innerHTML='';
- pltsTipLayer.style.display='none';
- return true;
- }
- }
- function moveToMouseLoc()
- {
- if(pltsTipLayer.innerHTML=='')return true;
- var MouseX=event.x;
- var MouseY=event.y;
- var popHeight=pltsTipLayer.clientHeight;
- var popWidth=pltsTipLayer.clientWidth;
- if(MouseY+pltsoffsetY+popHeight>document.body.clientHeight)
- {
- popTopAdjust=-popHeight-pltsoffsetY*1.5;
- pltsPoptop.style.display="none";
- pltsPopbot.style.display="";
- }
- else
- {
- popTopAdjust=0;
- pltsPoptop.style.display="";
- pltsPopbot.style.display="none";
- }
- if(MouseX+pltsoffsetX+popWidth>document.body.clientWidth)
- {
- popLeftAdjust=-popWidth-pltsoffsetX*2;
- topleft.style.display="none";
- botleft.style.display="none";
- topright.style.display="";
- botright.style.display="";
- }
- else
- {
- popLeftAdjust=0;
- topleft.style.display="";
- botleft.style.display="";
- topright.style.display="none";
- botright.style.display="none";
- }
- pltsTipLayer.style.left=MouseX+pltsoffsetX+document.body.scrollLeft+popLeftAdjust;
- pltsTipLayer.style.top=MouseY+pltsoffsetY+document.body.scrollTop+popTopAdjust;
- return true;
- }
- pltsinits();
- </script>
- </head>
- <body>
- 链接提示效果:<a href="http://www.lanrentuku.com/" target="_blank" title="title及alt提示特效,本程序由水木设计联盟整理推荐,希望大家喜欢">一个很酷的鼠标悬停特效,但有问题指教,我想知道怎么控制悬停时间</a>
- </body>
- </html>
title及alt提示特效的更多相关文章
- title与alt的区别
html中的title属性和alt属性让人有些混淆. 以前不知道有title这个属性,第一次用到它时,就和alt产生了混淆.一位朋友告诉我说,alt是图片img标签里用的,title是超链接里用的, ...
- 【转】title与alt的区别
html中的title属性和alt属性让人有些混淆. 以前不知道有title这个属性,第一次用到它时,就和alt产生了混淆.一位朋友告诉我说,alt是图片img标签里用的,title是超链接里用的,当 ...
- html中的title和alt
alt是html标签的属性,而title既是html标签,又是html属性. title标签这个不用多说,网页的标题就是写在<title></title>这对标签之内的.tit ...
- <img>的title和Alt有什么区别?
Alt是<img>的特有属性,是图片内容的等价描述,用于图片无法加载时显示,读屏器阅读图片. title 可提高图片高可访问性,除了纯装饰图片外都必须设置有意义的值,搜索引擎会重点分析.鼠 ...
- 如何写一个网页标题title的闪动提示(转)
通过网页title来提示用户有新消息这个功能很常见,比如现在的微博,还有一些邮箱,这个功能都很常见.如何实现则个功能呢? 思路是:通过ajax访问后台,若有新消息,则将网页的title替换为 提示信息 ...
- 如何写一个网页标题title的闪动提示
通过网页title来提示用户有新消息这个功能很常见,比如现在的微博,还有一些邮箱,这个功能都很常见.如何实现则个功能呢? 思路是:通过ajax访问后台,若有新消息,则将网页的title替换为 提示信息 ...
- css3 小图标提示特效
最近的计划,就是每天来几个特效,当然这里有限制,在什么候选区只能放一个,还每天有限制发布的,哎, 啊 终于写完了,看到一个挺好玩的东西,想到能不能用网页的特效做出来,试试呗!不过,一想肯东有很多的 相 ...
- 手写一个关于title属性自定义提示框解决浏览器(IE)不兼容问题
<html> <head> <meta charset="utf-8"> <title>无标题页</title> < ...
- 5.href和src区别? title和alt【CSS】
1.href (Hypertext Reference)指定网络资源的位置(超文本引用),从而在当前元素或者当前文档和由当前属性定义的需要的锚点或资源之间定义一个链接或者关系,在 link和a 等元素 ...
随机推荐
- [转]Windows网络编程学习-面向连接的编程方式
直接附上原文链接:windows 网络编程学习-面向连接的编程方式
- 使用js使某个按钮在5秒内不能重复点击
<head> <!--参考:http://illy.iteye.com/blog/1534276 --> <!-- http://y.dobit.top/Detail/1 ...
- Android自动化压力测试图解教程——Monkey工具
[置顶] Android自动化压力测试图解教程--Monkey工具 标签: 测试androidprofiling工具测试工具文档 2012-04-01 10:16 38185人阅读 评论(10) 收藏 ...
- JSTL 标签库 使用
标签库概要: 一.C标签库介绍 1.1.<c:> 核心标签库 JSTL 核心标签库(C标签)标签共有13个,功能上分为4类:1.表达式控制标签:out.set.remove.catch2 ...
- [CareerCup] 2.6 Linked List Cycle 单链表中的环
2.6 Given a circular linked list, implement an algorithm which returns the node at the beginning of ...
- 文本模板转换工具包和 ASP.NET MVC
http://msdn.microsoft.com/zh-sg/magazine/ee291528.aspx
- 要期末了搞不了OI了额……
TAT~~~~~~期中完挂,求RP求期末逆袭
- Pell方程及其一般形式
一.Pell方程 形如x^2-dy^2=1的不定方程叫做Pell方程,其中d为正整数,则易得当d是完全平方数的时候这方程无正整数解,所以下面讨论d不是完全平方数的情况. 设Pell方程的最小正整数解为 ...
- C#基础知识系列六(静态类和静态类成员)
静态类 静态类与非静态类基本相同,但存在一个区别:静态类不能实例化. 也就是说,不能使用 new 关键字创建静态类类型的变量. 因为没有实例变量,所以要使用类名本身访问静态类的成员. 例如,如果名为 ...
- WRONGTYPE Operation against a key holding the wrong kind of value
今天改动代码,一运行就跑错了,错误原因: 因为redis中已经存在了相同的key, 而且key对应的值类型并不是Set,而是SortSet(改动前):再调用smembers时,抛出此错误. 解决方法: ...