我现在碰到的问题是这样的:
当我鼠标移动到超链接项时候调用数据库中对应的信息,当页面上有一条信息的时候能成功显示,但是当有多条的时候就显示 undefined字样,我用的是FOR循环显示出来的,代码如下<style>
#hint{
        display:none;
        position:absolute;
        width:200px;
        height:10;
        boder:1px;
        background:lightblue;
}
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showme()
{
var oSon=window.document.getElementById("hint");
if (oSon==null) return;
with (oSon) 
{
  innerText=guoguo.value;
  style.display="block";
  style.pixelLeft=window.event.clientX+window.document.body.scrollLeft+6;
  style.pixelTop=window.event.clientY+window.document.body.scrollTop+9;
}
}
function hidme()
{
var oSon=window.document.getElementById("hint");
if (oSon==null) return;
oSon.style.display="none";
}
//-->
</SCRIPT>
//这里的LIST是我用额外定义的,就是将后面SELECT的内容取出来存入
<?list($aa)=fields("select get_depart_name($depart_no) from dual"); // DIV层
echo    "<text id=guoguo value='$aa'>";
echo    "<td width='20'><a href=# onmouseover=showme() onmouseout=hidme() onmousemove=showme() son=hint>$depart_no</a></td>";
?>
<div id=hint style="display:none"></div>各位大大有空帮我看看哦。在线等

解决方案 »

  1.   

    没看到for语句怎么写的,是不是for语句中循环除了多个id=hint
      

  2.   

    FOR循环是这样的
    for($c=0;list($depart_no,$preset_date)=$st1->fetch();$c++)

    list($aa)=fields("select get_depart_name($depart_no) from dual"); // DIV层
    echo    "<text id=guoguo value='$aa'>";
    echo    "<td width='20'><a href=# onmouseover=showme() onmouseout=hidme() onmousemove=showme() son=hint>$depart_no</a></td>";