Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1181790
  • 博文数量: 252
  • 博客积分: 5421
  • 博客等级: 大校
  • 技术积分: 2418
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-17 12:59
文章分类

全部博文(252)

文章存档

2017年(3)

2016年(18)

2015年(31)

2014年(18)

2013年(7)

2012年(8)

2011年(12)

2010年(30)

2009年(32)

2008年(57)

2007年(36)

分类: 系统运维

2007-07-25 14:43:26

一、
-----------------------------------------------------
js:

var oPopup = window.createPopup();
function rdl_doClick(){
var oMessage=document.all("oMessage");
with (oPopup.document.body) {
style.backgroundColor="lightyellow";
style.border="solid black 1px";
innerHTML=oMessage.value;
}
oPopup.show(70, 70, 180, 60);
}


html:

<input id=oMessage type=hidden size=40 value="点击弹出窗口外面的区域关闭它。">
<br><br>
<a href="#" onmouseover="rdl_doClick()" onmouseout="oPopup.hide();">显示弹出窗口 </a>

--------------------------------------------------
二、
------------------------------------------------------
js:

function show(tips,flag,url){
var my_tips=document.all.mytips;
if(flag){
    my_tips.style.display="";
    if (url!=null){my_tips.innerHTML=""+tips;}
    else{ my_tips.innerHTML=tips;}
    my_tips.style.left=event.clientX+10;
    my_tips.style.top=event.clientY+10;
   }
else
  {
   my_tips.style.display="none";
   }
}


html:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<STYLE type=text/css>BODY {
    MARGIN-TOP: 0px; FONT-SIZE: 9pt; MARGIN-LEFT: 4px; MARGIN-RIGHT: 0px; FONT-FAMILY: "宋体"
}
A {
    FONT-WEIGHT: 400; FONT-SIZE: 13px; COLOR: black; TEXT-DECORATION: none
}
A:hover {
    FONT-WEIGHT: 400; FONT-SIZE: 13px; COLOR: red; TEXT-DECORATION: underline
}
A:active {
    FONT: 9pt "宋体"; CURSOR: hand; COLOR: #ff0033
}
</style>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>

<body>
<a href="#" tips="自定义提示" onmousemove=show(this.tips,1) onmouseout=show(this.tips,0)>测试链接</a>
<a href="#" tips="又一个自定义提示" onmousemove=show(this.tips,1,'http://be10.ods.org/51js/images/standard/online_member.gif') onmouseout=show(this.tips,0)>测试链接</a>
<a href="#" tips="中华人民共和国中华人民共和国自定义提示" onmousemove=show(this.tips,1,'http://be10.ods.org/51js/images/standard/online_moderator.gif') onmouseout=show(this.tips,0)>测试链接</a>

<div id=mytips style="position:absolute;width:150;height:16;border:1 gray solid;font-size:9pt;background-color:#ffffff;color:red;display:none;filter: progid:DXImageTransform.Microsoft.Shadow(color=#999999,direction=135,strength=3);">
</div>

</body>
</html>

阅读(2274) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~