easyui 中datagrid onmouseout onmouseover事件怎么用

<table id="tblContent"  runat="server" border="0" cellpadding="0" cellspacing="0" onmouseout="this.style.backgroundColor=this.DefaultColor;"
                                onmouseover="this.DefaultColor=this.style.backgroundColor;this.style.backgroundColor='#E4F8FF';" style="padding: 5px; background-color: #FFF"
                                width="100%">
                                <tr>
                                    <td valign="top" align="center" rowspan="2" style="width: 50px;">
                                        <img alt="查看原文" style="border: none; cursor: pointer;" src="images/file_sa.png"  onclick="OpenWin('<%#Eval("Bzbh") %>');return false;"/></td>
                                    <td style="height: 20px;" valign="top">
                                        <span style="font-size:14px;font-weight:bold;"><asp:Literal ID="litTitle" runat="server"></asp:Literal></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="padding-right: 10px;">
                                        <asp:Literal ID="litSummary" runat="server"></asp:Literal>
                                    </td>
                                </tr>
                            </table>

这是以前的老项目中用的 现在想用onmouseout onmouseover事件 可是不知道怎么用,想要的效果就是当datagrid某单元格内容过多时,鼠标放上去内容能自动显示全,哪位大神给个demo,或者告诉我怎们做,谢谢啦

阅读 2.8k
1 个回答
        .tdsty{
            text-align:center;
            white-space:normal;
        }

        setTimeout(function(){
            $('.datagrid-body tr td').hover(function(){
                $(this).find('div').addClass('tdsty')
            },function(){
                $(this).find('div').removeClass('tdsty')
            })
        },0)

自己写了一个js 效果可以出来

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题