div.style.top=event.y
div.style.left = event.x
visibility="visible"

解决方案 »

  1.   

    不成功哦.<SCRIPT LANGUAGE="JavaScript">
    <!--function showDIV(did,id)
    { if (did.style.visibility=='visible')
    {
    did.style.top=event.y
    did.style.left = event.x did.style.visibility='hidden';
    }
    else
    {
    did.style.top=event.y
    did.style.left = event.x
    did.style.visibility='visible';
    }}
    //-->
    </SCRIPT>
    <DIV id=d44 style='visibility:hidden;' height=0>这里显示内容</DIV><P>dddd</p>
    <P>dddd</p>
    <P>dddd</p>
    <P>dddd</p>
    <P>dddd</p>
    <P>dddd</p>
    <P>dddd</p>
    <a href=javascript: onclick=showDIV(d44,5555)>分类</a>
    还是原始位置显示
      

  2.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD><BODY>
                <br>
                <a href="../../../www.163.net/index.html" onMouseOver="showtip2(this,event,'163免费电子邮局是一个提供免费服务的网站。')" onMouseOut="hidetip2()">163电子邮局</a> 
    <a href="../../../www.gznet.com/index.html" onMouseOver="showtip2(this,event,' 广州视窗')" onMouseOut="hidetip2()"> 
                广州视窗</a> 
        <div id="tooltip2" style="position:absolute;clip:rect(0 150 50 0);width:150px;background-color:#99FF99; top: 31px; left: 103px; visibility: hidden; height: 13px">       <script language="javascript">
    if (!document.layers&&!document.all)
    event="test"
    function showtip2(current,e,text){if (document.all&&document.readyState=="complete"){
    document.all.tooltip2.innerHTML='<marquee style="border:1px solid black">'+text+'</marquee>'
    document.all.tooltip2.style.pixelLeft=event.clientX+document.body.scrollLeft+10
    document.all.tooltip2.style.pixelTop=event.clientY+document.body.scrollTop+10
    document.all.tooltip2.style.visibility="visible"
    }else if (document.layers){
    document.tooltip2.document.nstip.document.write('<b>'+text+'</b>')
    document.tooltip2.document.nstip.document.close()
    document.tooltip2.document.nstip.left=0
    currentscroll=setInterval("scrolltip()",100)
    document.tooltip2.left=e.pageX+10
    document.tooltip2.top=e.pageY+10
    document.tooltip2.visibility="show"
    }
    }
    function hidetip2(){
    if (document.all)
    document.all.tooltip2.style.visibility="hidden"
    else if (document.layers){
    clearInterval(currentscroll)
    document.tooltip2.visibility="hidden"
    }
    }function scrolltip(){
    if (document.tooltip2.document.nstip.left>=-document.tooltip2.document.nstip.document.width)
    document.tooltip2.document.nstip.left-=5
    else
    document.tooltip2.document.nstip.left=150
    }</script>
    </BODY>
    </HTML>
    你参考下
      

  3.   

    非常感谢,原来要定义DIV的属性:style="position:absolute