列表中显示不全的用“……”表示,鼠标经过的时候可以显示全部信息。 最好有代码.谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <a href="#" title='aaaaa'>a...</a> <!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=""> <style> .c1{ overflow:hidden; text-overflow:ellipsis; white-space: nowrap; } .c2{} </style> </HEAD> <BODY> <table width=140 border=1 style=table-layout:fixed> <tr><td class="c1">wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww</td></tr> </table> </BODY> <script> var td = document.getElementsByTagName("TD"); for(var i=0; i<td.length; i++){ if(td[i].className == "c1"){ td[i].attachEvent("onmouseover", function(){ window.event.srcElement.className = "c2"; }); td[i].attachEvent("onmouseout", function(){ window.event.srcElement.className = "c1"; }); } } </script></HTML> 估计你是先从数据库里读出值,按照 "新闻....." 这种省略形式表现,然后当MOUSE移上去的时候,出现全部的标题可以这样做:<a href='URL' title='<%#Eval("绑定的字段值")%>'> 这里取所绑定字段的前几个字符即可 </a> 前台相应的位置绑定数据:GetDemand为后台一函数<%# GetDemand(DataBinder.Eval(Container, "DataItem.字段名").ToString(),DataBinder.Eval(Container, "DataItem.要连接到的字段名").ToString())%>后台:protected string GetDemand(string strDemand,string hrefid)//显示主题,限定最长字数为10个{ string subDemand = strDemand; if(subDemand.Length > 10) {subDemand = subDemand.Substring(0,10) + "...";}string titleDemand = strDemand.Replace("<br/>","\r\n").Replace(" "," ");string HtmlTitle = "<A href='aa.aspx?id=/"+hrefid+"'target='_blank' title=\"" + titleDemand + subDemand + "</A>";return HtmlTitle; } <a title=' <%# Eval("字段")%>'> </a>, GV中可以这样吗? <label style="cursor:default" title="all text">...</label> 如何 接收邮件 重点:OP 解码 FileUpload 控件中的浏览(按钮)无法显示 DIV问题 请教,如何限制单个用户一天只能成功登录一次,失败不计 把数据保存在js全局变量中可行吗 此类做法是否让百度搜录很少 ,如何避免? Request筛选参数 请问"select 1 from table where id=condition"这句的返回结果及它的意思 新增一条数据后,马上获取这条记录的ID号 怎么页面重定向?target在c#中怎么用? gridview 中筛选数据的问题? datalist 显示数据
<!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="">
<style>
.c1{
overflow:hidden;
text-overflow:ellipsis;
white-space: nowrap;
}
.c2{}
</style>
</HEAD> <BODY>
<table width=140 border=1 style=table-layout:fixed>
<tr><td class="c1">wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww</td></tr>
</table>
</BODY>
<script>
var td = document.getElementsByTagName("TD");
for(var i=0; i<td.length; i++){
if(td[i].className == "c1"){
td[i].attachEvent("onmouseover", function(){
window.event.srcElement.className = "c2";
});
td[i].attachEvent("onmouseout", function(){
window.event.srcElement.className = "c1";
});
}
}
</script>
</HTML>
DataBinder.Eval(Container, "DataItem.要连接到的字段名").ToString())%>后台:
protected string GetDemand(string strDemand,string hrefid)//显示主题,限定最长字数为10个
{
string subDemand = strDemand;
if(subDemand.Length > 10)
{
subDemand = subDemand.Substring(0,10) + "...";
}
string titleDemand = strDemand.Replace("<br/>","\r\n").Replace(" "," ");
string HtmlTitle = "<A href='aa.aspx?id=/"+hrefid+"'target='_blank' title=\"" + titleDemand + subDemand + "</A>";return HtmlTitle;
}
GV中可以这样吗?