html顯示長度較大的數(shù)據(jù)時(shí)的處理方法

字號(hào):


    在html中顯示長度較大的數(shù)據(jù)時(shí),可以將數(shù)據(jù)截取顯示,當(dāng)鼠標(biāo)滑過時(shí)再顯示完整數(shù)據(jù)。
    例如,下面這種情況。
    實(shí)現(xiàn):
    代碼如下:
    <a>
    <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>