[javascript]文字鏈接提示圖片 不指定

Else , 2009/03/09 11:55 , 代码片段,演示也有 , Comments(1) , Reads(1160) , Via Original
[hcode]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>文字鏈接提示圖片</title>
<script language="javascript">
function showPic(sUrl){
var x,y;
x = event.clientX;
y = event.clientY;
document.getElementById("Layer1").style.left = x;
document.getElementById("Layer1").style.top = y;
document.getElementById("Layer1").innerHTML = "<img src=\"" + sUrl + "\">";
document.getElementById("Layer1").style.display = "block";
}
function hiddenPic(){
document.getElementById("Layer1").innerHTML = "";
document.getElementById("Layer1").style.display = "none";
}
</script>
</head>
<body>
<div id="Layer1" style="display:none;position:absolute;z-index:1;"></div>
<img src="http://www.aixq.com/img/logo.gif" onmouseout="hiddenPic();" onmousemove="showPic(this.src);" />
<p></p>
<a href="#" rev="http://www.aixq.com/img/logo.gif" onmouseout="hiddenPic();" onmousemove="showPic(this.rev);">這個是文字</a>
</body>
</html>[/hcode]
Tags:
wxxslt
2009/03/09 12:43
crycry
ff下不起作用?
Else replied on 2009/03/10 09:05
測試了一下,還真的不行!
Pages: 1/1 First page 1 Final page
Add a comment

Nickname

Site URI

Email

Enable HTML Enable UBB Enable Emots Hidden Remember [Login] [Register]