日期:2014-05-19  浏览次数:20481 次

鼠标划过gridview的某一栏...?
鼠标划过gridview的某一栏位“test”时,显示div,如何让div的位置无论什么情况都位于栏位“test”正下方?

<script>
function   ShowTip(id)
{
document.body.style.cursor   =   "wait ";
document.getElementById( "lbTest ").style.visibility   =   "visible ";

}
function   HideTip()
{
document.body.style.cursor   =   " ";
document.getElementById( "lbTest ").style.visibility   =   "hidden ";
}
<script>
前台:
<div   id= "lbTest "   runat= "server "   style= "BORDER-RIGHT:   #ffffff   1px   solid;   BORDER-TOP:   #ffffff  

1px   solid;   Z-INDEX:   101;   LEFT:   420px;     BORDER-LEFT:   #ffffff   1px   solid;   WIDTH:   240px;  

BORDER-BOTTOM:   #ffffff   1px   solid;   POSITION:   absolute;   TOP:   165px;   BACKGROUND-COLOR:  

#eeeeee;   zOrder:   2000;color:red;   font-size:   9pt; ">
aaaaaaaaaaaaaaaaa </div>

后台:
e.Row.Cells[5].Attributes.Add( "onmouseover ",   "javascript:ShowTip( ' "   +   "lbTest "   +   " ') ");
  e.Row.Cells[5].Attributes.Add( "onmouseout ", "javascript:HideTip() ");

------解决方案--------------------
鼠标过那一栏时记录下坐标位置,然后把div放置相应位置