<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>鼠标移动到图片名上显示图片-www.jb200.com</title>
<script type="text/
javascript">
var path = './'; //图片
相对路径
function show(obj) {
var name = obj.innerText;
var sDiv = document.getElementById('img_' + name.split('.')[0]);//文件名自己判断
if (!sDiv) {
sDiv = document.createElement("DIV");
sDiv.id = 'img_' + name.split('.')[0];
sDiv.style.position = 'absolute';
sDiv.style.top = obj.offsetTop + obj.offsetWidth + 'px';
sDiv.style.left = obj.offsetLeft +obj.offsetHeight + 'px';
sDiv.style.border = '1px red solid';
var img = document.createElement("img");
img.src = path + name;
sDiv.appendChild(img);
document.body.appendChild(sDiv);
}
sDiv.style.display = 'block';
}
function f(obj) {
var name = obj.innerText;
var sDiv = document.getElementById('img_' + name.split('.')[0]);//文件名自己判断
if (sDiv) {
sDiv.style.display = 'none';
}
}
</script>
</head>
<body>
<div onmouseover="show(this)" onmouseout="f(this)" style="position:absolute;">
wait.gif
</div>
</body>
</html>