在tip条中加网址链接怎么做?就是鼠标停在一个字上然后显示黄颜色的提示条,在提示条里面要做一个网址链接。 有人给我一段代码
<style type="text/css">
#tip{position:relative;top:-50px;right:-30px;;border:1px solid blue;width:100px;height:60px;background-color:#efefef;display:none;}
</style>
<script language="javascript">
var flag=false;
function showIt(){
tip.style.display="block";
}
function hideIt(){
if(flag==false){
document.all.tip.style.display="none";
}
}
function handlerOver(){
flag=true;
showIt();
}
function handlerOut(){
flag=false;
setTimeout("hideIt()", 3000);
}
</script>
</head>
<body>
<span id="aaa" onmouseover="handlerOver()" onmouseout="handlerOut()"> 点击 <div id="tip" onmouseover="handlerOver()" onmouseout="handlerOut()"><a href="http://www.jiangfan.net">here is a tip</a></div></span>现在问题来了 代码里面的“点击”的个数是不知道的,是从数据库里面循环取出来的,那么这段javascript 该怎么循环,因为var tip=document.getElementById("tip");里的tip要循环的一个tip对应1个id