function subStForTable(str,strLen){
var sb ="";
if(str.length>strLen){
sb +='<span title ="'+str+'">'+str.substr(0,strLen)+'...</span>';
}else{
sb +='<span title ="'+str+'">'+str+'</span>';
}
return sb;
}
我写的一个js的 截取方法
解决方案 »
- 校园资源共享平台的二维码下载专区
- Connections could not be acquired from the underlying database
- 调webservice 用eclipse 生成的 httpClient代理类怎么用啊?
- JFreeChart中xy坐标的问题
- 用lucene做海量数据检索的高手进来
- 如何用ADO方式把JSP和ACCESS连接上???
- 请问 如何实现 边输入边查询 的功能???
- 无法调用外部js
- resin 支持struts吗?如果是,jbuilder9+tomcat做的war文件解压后的目录结构,能在resin中用吗?
- 关于java web 中cookie 清除 ,产生了两个同名cookie的问题
- session 和 application 的区别。求详解
- 导spring1.2的包可以用2.0的事务配置写法吗?
<html>
<body>
<table>
<tr>
<td title="我是一个中国人我爱中国">我是一个............</td>
</tr>
</table>
</body>
</html>
相关代码
<tr>
<td><div align="center"><strong>网站广告信息的查询</strong></div></td>
</tr>
</table>
<br>
<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="CCCCCC">
<tr>
<td width="15%" height="25"><div align="center">广告编号</div></td>
<td width="20%"><div align="center">图片名称</div></td>
<td width="25%"><div align="center">图片地址</div></td>
<td width="28%"><div align="center">广告链接</div></td>
<td width="35%"><div align="center">操作</div></td>
</tr>
<% for(int i=start;i<over;i++){
AdvertisementForm adform=(AdvertisementForm)list.get(i);
%>
<tr bgcolor="#FFFFFF">
<td height="5"><div align="center"><%=adform.getId() %></div></td>
<td><div align="center"><%=adform.getImageName() %></div></td>
<td><div align="center"><%=adform.getImagePath() %></div></td>
<td><div align="center"><%=adform.getAdPageUrl() %></div></td>
<td><div align="center">
<a href="advertisementAction.do?action=2&id=<%=adform.getId() %>">修改</a>
<a href="javascript:deleteAdver('<%=adform.getId()%>')">删除</a>
</div></td>
<%}%> </tr>
</table>
background: #eee;
color: #333;
z-index: 999;
}
.newsInfo {
color:black;
position: relative;
z-index: 0;
}
.newsInfo span {
display: none;
}
/*设置正常下的span为隐藏状态*/
.newsInfo:hover span {
display: block;
position: absolute;
min-width:400px;
top: 28px;
left:100px;
border: 1px solid #cccccc;
background: #fff;
color: #333;
padding: 5px;
text-align: left;
overflow: hidden;
}.newInfoTruncation {
width:300px;
white-space:nowrap;
word-break:keep-all;
overflow:hidden;
text-overflow:ellipsis;
} <html>
<head>
<link href="index.css" rel="Stylesheet" type="text/css" />
</head>
<body>
<div>
<a href="#"class="newsInfo">
<div class="newInfoTruncation">
2010年度深圳市因私出入境中介机构信息公布 28家出入境中介机构通过审核
</div>
<span>
2010年度深圳市因私出入境中介机构信息公布 28家出入境中介机构通过审核
</span>
</a>
</div>
</body>
</html>