超级链接点击浮动广告显示JS代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" C>
<META NAME="Author" CKeywords" CDescription" Ctext/javascript">
function showPics(path)
{
var len=path.lastIndexOf("/");
var filePath=path.substring(path.substring(0,len).lastIndexOf("/")+1);
var divContainer=document.getElementById("div1");
//加上此段,改下<a
if(len=="-1")
{
divContainer.style.visibility="hidden";
return;
}
//......................
var imgObj=document.getElementById("img1");
imgObj.src=filePath;
var x=0;
var y=0;
if(document.all)
{
x=event.clientX;
y=event.clientY;
}
else
{
x=event.pageX;
y=event.pageY;
}
divContainer.style.visibility="visible";
//divContainer.style.position="absolute";
divContainer.style.left=20+x;
divContainer.style.top=20+y;
}
</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<a href="img/1_pros1.jpg" >PIC1</a><br>
<a href="img/1_pros2.jpg" >PIC1</a><br>
<a href="img/1_pros3.jpg" >PIC1</a><br>
<a href="img/1_pros4.jpg" >PIC1</a><br>
<a href="img/1_pros5.jpg" >PIC1</a><br>
<div id="div1" style="padding:0px;margin:0px;width:10px;height:10px;left:0px;visibility:hidden;top:0px;background-color:#ff0000;position:absolute;z-index:100;">
<img src="" id="img1"/>
</div>
</BODY>
</HTML>