html顯示長數據的處理方法

在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>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章