<div id="goodIntroduction">
在漫无边际的海水上漂流,偶尔抬头能看见熟悉的日月星辰。
因为我不知道下辈子是否还能遇见你,所以我今生才会那么努力把
最好的给你。 陪伴,是最长情的告白;而声音,是最温柔的陪伴!
</div>
var str = $("#goodIntroduction").text();
var tempt = str;
coverup();
function coverup() {
if (str.length > 17) {
$("#goodIntroduction").text(tempt.slice(0, 17) + "...");
}
var readmore = "<a onclick='showmore()' style='color: orange;'>查看更多↓</a>"
$("#goodIntroduction").append(readmore);
}
function showmore() {
$("#goodIntroduction").text(str);
var readmore = "<a onclick='coverup()' style='color: orange;'>收起↑</a>"
$("#goodIntroduction").append(readmore);
}