您的位置:首页 > 其它

鼠标移到datalist或者是grivdview上显示全部内容

2015-07-09 22:25 459 查看
<script>
$("td.TIP").mouseover(function (e) {
this.myTitle = this.title;
this.title = "";
var toolTip = "<div id='tooltip'>" + this.myTitle + "</div>";
$("body").append(toolTip);
$("#tooltip").css({
"position": "absolute",
"padding": "5px",
"background": "#F0F0E8",
"border": "1px gray solid",
"top": (e.pageY + y) + "px",
"left": (e.pageX + x) + "px"
}).show(200);
}).mouseout(function () {
this.title = this.myTitle;
$("#tooltip").remove();
}).mousemove(function (e) {
$("#tooltip").css({
"background": "#F0F0E8",
"padding": "5px",
"border": "1px gray solid",
"top": (e.pageY + y) + "px",
"left": (e.pageX + x) + "px"
})
})
</script>


<td class="TIP" title='<%#Eval("IntNewsContent")%>'><%# BaseClass.CheckStr(Eval("IntNewsContent"), 5)%></td>


public static string CheckStr(object strValue, int Len) //字符串截取函数,如果长度大于30,则只显示前30个字符
{
return (strValue.ToString().Length > Len) ? strValue.ToString().Substring(0, Len) + ".." : strValue.ToString();
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: