一、
-----------------------------------------------------
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>
|
阅读(2305) | 评论(1) | 转发(0) |