您的位置:首页 > Web前端 > HTML

html显示长度较大的数据时的处理方法

2014-05-28 18:07 417 查看
在html中显示长度较大的数据时,可以将数据截取显示,当鼠标滑过时再显示完整数据。
例如,下面这种情况。



实现:

<a title="${siteBoardInfoList.boardUrl}"> 
<c:if test="${fn:length(siteBoardInfoList.boardUrl) >= 40}"> 
${fn:substring(siteBoardInfoList.boardUrl,0,20)}......${fn:substring(siteBoardInfoList.boardUrl,fn:length(siteBoardInfoList.boardUrl)-21,fn:length(siteBoardInfoList.boardUrl))} 
</c:if> 
<c:if test="${fn:length(siteBoardInfoList.boardUrl) < 40}"> 
${siteBoardInfoList.boardUrl} 
</c:if> 
</a>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐