首页>互联网>语言脚本>JavaScript>正文

自定义超链接的Title

日 期:2006-04-13     来 源:    阅 读:
  

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>自定义title - 51windows.net</title>
</head>
<body>
<p><B>自定义title</B>(IE):把鼠标放在下面的文字上查看效果</p>
<span title="Javascript" title="">默认效果</span><br><br>
<span title="<marquee style='width:100px;'>www.51windows.net</marquee>" altbg="red" altcolor="yellow" altborder="yellow">滚动字幕</span><br><br>
<span title="<img src='/web/UploadFiles_1001/200604/20060413182849860.gif' border='0'>" altbg="#F7F7F7" altcolor="#999999" altborder="#CCCCCC">图片</span><br><br>
<span title="<i style='font-size:24pt;font-family:verdana;'>www.51windows.net</i>" altbg="green" altcolor="yellow" altborder="darkgreen">大字体</span><br><br>
<div style="display:none;border:1px solid #000000;background-color:#FFFFCC;font-size:12px;position:absolute;padding:2;" id=altlayer></div>
<SCRIPT LANGUAGE="JavaScript">
<!--
document.body.onmousemove=quickalt;
document.body.onmouseover=getalt;
document.body.onmouseout=restorealt;
var tempalt='';

function getalt(){
 if(event.srcElement.title && (event.srcElement.title!='' || (event.srcElement.title=='' && tempalt!=''))){
  altlayer.style.left=document.body.scrollLeft+event.clientX;
  altlayer.style.top=document.body.scrollTop+event.clientY;
  altlayer.style.display='';
  tempalt=event.srcElement.title;
  tempbg=event.srcElement.altbg;
  tempcolor=event.srcElement.altcolor;
  tempborder=event.srcElement.altborder;
  event.srcElement.title='';
  altlayer.innerHTML=tempalt;
  if (typeof(tempbg)!="undefined"){altlayer.style.background=tempbg}else{altlayer.style.background="infobackground"}
  if (typeof(tempcolor)!="undefined"){altlayer.style.color=tempcolor}else{altlayer.style.color=tempcolor="infotext"}
  if (typeof(tempborder)!="undefined"){altlayer.style.border='1px solid '+tempborder;}else{altlayer.style.border='1px solid #000000';}
 }
}
function quickalt(){
 if(altlayer.style.display==''){
  altlayer.style.left=document.body.scrollLeft+event.clientX;
  altlayer.style.top=document.body.scrollTop+event.clientY;
 }
}
function restorealt(){
 event.srcElement.title=tempalt;
 tempalt='';
 altlayer.style.display='none';
}
//-->
</SCRIPT>
</body>
</html>


上一篇:用层模拟的窗口   下一篇:Web Tabs
收藏本文到:
digg this! 添加到del.icio.us bbmao网络收藏夹 添加到365key 我顶 添加到bolaa 推荐到奇客发现 添加到新浪vivi 添加到google书签 添加到yahoo+
查看全部JavaScript内容  
  • 用层模拟的窗口  2006-04-13 00:00:00
       html head title_xWin/title meta http-equiv="Content-Type" content="text/html; charset=gb2312" META NAME="Description" CONTENT=" http://www.51windows.Net " style...[阅读全文]
  • Web Tabs  2006-04-13 00:00:00
       html head titleWeb Tabs Demo - 51windows.net/title style body { background: buttonface; font-family: Tahoma; font-size: 12px; margin: 0px } div,td{font-size:9pt...[阅读全文]
  • 模拟QQ的菜单  2006-04-13 00:00:00
       STYLE type="text/css" A:link { COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: none} A:visited { COLOR: #000000; FONT-SIZE: 12px; TEXT-DECORATION: none} A:hov...[阅读全文]
  • 跟随鼠标的八条线(IE)  2006-04-13 00:00:00
       html title跟随鼠标的八条线 -51windows.Net/title head meta name="keywords" content="51windows.Net" meta http-equiv=Content-Type content="text/html; charset=gb231...[阅读全文]
  • 效果不错的变色菜单  2006-04-13 00:00:00
       style /* 先把这个 xmenu 的样式放到css里 */ .xmenu td{font-size:12px;font-family:verdana,arial;font-weight:bolder;color:#ffffff;border:1px solid #336699;backgrou...[阅读全文]
  • 多级右键菜单  2006-04-13 00:00:00
       HTMLHEADTITLE多级右键菜单 - 51windows.Net/TITLE META content="text/html; charset=gb2312" http-equiv=Content-Type STYLE type=text/cssBODY { FONT-SIZE: 12px; } .i...[阅读全文]
  • ie里window的method列表  2006-04-13 00:00:00
       alert(sMsg) //弹出一个确认消息框 attachEvent(sEvent,pFunction) //绑定一个函数到某个事件,事件触发时随机执行其中一个被绑定的函数 blur() //令窗口丧失焦点 clearInt...[阅读全文]
  • 特效代码收集  2006-04-13 00:00:00
       滚动条 CODE:[url=###][Copy to clipboard][/url] 1.overflow内容溢出时的设置(设定被设定对象是否显示滚动条) overflow-x水平方向内容溢出时的设置 overflow-y垂直方向...[阅读全文]
  • 轻松搞定网页的【简繁转换】  2006-04-13 00:00:00
       对网页进行简繁字体转换的方法一般有两种:一是使用《简繁通》这样的专业软件,另外一种是制作两套版本的网页。显然,这两种方法都较为麻烦,而且专业软件一般不能用于...[阅读全文]
  • 用JavaScript保护页面  2006-04-13 00:00:00
       //不允许页面单独打开 if (window.top.location==window.location){ window.top.location="指定的地址"; } //不允许页面嵌在框架里 if (window.top.location!=window.locat...[阅读全文]
  • JS脚本控制的广告-对联(没有关闭)  2006-04-12 00:00:00
       function initEcAd() { document.all.AdLayer1.style.posTop = -200; document.all.AdLayer1.style.visibility = 'visible' document.all.AdLayer2.style.posTop = -200; d...[阅读全文]
  • 图片下拉选择器的制作(2)  2006-10-22 00:00:00
       第三 ,图片下拉列表框的滚动,要保证自动滚动到相应的图片出现在列表框的顶端:当手动滚动停止时,如果滚动条趋势是向下滚动,则自动继续向下滚动直至最近的图片在列表框...[阅读全文]
  • 图片下拉选择器的制作(1)  2006-10-22 00:00:00
       相信大家都见过一些软件里的图片下拉选择控件吧?喏,OICQ中就有。但网页上的你见过没有?小阳今天就为你推出你心怡已久的这个控件,下面演示中就是了!效果还可以吧?心动...[阅读全文]
  • 用javascript实现浏览器地震效果  2006-10-22 00:00:00
       一种把人吓一跳的感觉。实现方法是,把下面的JavaScript代码加入到 body与 /body之间: script language="JavaScript" function surfto(form) { var myindex=form.select1....[阅读全文]
  • 使主页呈现“飞舞”特效  2006-10-22 00:00:00
       朋友,“天上掉陷饼”都听说过吧?呵呵,陷饼它算个么,今天教你一个天上掉¥的招儿,并且~~哗啦啦地掉!哈~哈~哈,来吧^_* 首先看效果 将下面的JavaScript代码加到 he...[阅读全文]
  • 如何制作浮动广告  2006-10-22 00:00:00
       漫游于网络之间,你会发觉,因特网不但是信息的海洋,也是广告的海洋。除了普通的Gif Banner、Flash外,浮动广告也是时下网上较为流行的广告形式之一。当你拖动浏览器的滚...[阅读全文]
  • 让弹出窗口变得“体贴”一些  2006-10-22 00:00:00
       让弹出窗口变得体贴一些 在网上冲浪时进入一些网站会出现弹出窗口。它可能是站长对你的亲切问候,也可能是网站的重要通告、网站广告之类的。但用得不好会让人产生厌烦心理...[阅读全文]
  • 用javascript实现变色背景和文字(2)  2006-10-22 00:00:00
       2、前景文字: html head title bgcolor /title meta http-equiv="Content-Type" content="text/html; charset=gb2312" script language="JavaScript" !-- //you can assig...[阅读全文]
  • 初学javascript之cookie篇(1)  2006-10-22 00:00:00
       简介 ==================================== 问题是我想解决自动访问http://www.thehungersite.com。这个页面能够限制你每一天只访问它一次(不要忘记在这链接上点击)。 ...[阅读全文]
  • HTC——浏览器上的舞者  2006-10-22 00:00:00
       很久以来一直为页面工作的繁琐和杂乱而苦恼,做B/S很多时候痛苦就在做表现层这一块,业务逻辑和数据层的处理反而轻松不少。为什么?因为不能复用,大量的CSS和Javascript和...[阅读全文]
 用户名: 新注册) 密码: 匿名发表 评论(0条)
 评论内容:(不能超过250字,不支持HTML或代码,只能发表纯文字,请自觉遵守互联网相关政策法规。)
[an error occurred while processing this directive]
合作伙伴: 电脑综合 8vv8娱乐榜

关于扑虎 | 扑虎新闻 | 联系扑虎 | 广告服务 | 招贤纳士

Copyright @ 2006-2007 poohu.com. All Right Reserved 陕ICP备06010975号