@大尨,弄个框框把内容框住,超过一定字符折叠 小米5s Plus(拉丝深灰)
<script> function foldFold(floor) { var content = document.getElementById('floor_content_' + floor); var foldBar = document.getElementById('floor_fold_bar_' + floor); content.style.maxHeight = '768px'; foldBar.innerHTML = '<a id="floor_expand_' + floor + '" href="#" onclick="foldExpand(' + floor + ');return false">查看全部</a>'; } function foldExpand(floor) { var content = document.getElementById('floor_content_' + floor); var foldBar = document.getElementById('floor_fold_bar_' + floor); content.style.maxHeight = ''; foldBar.innerHTML = '<a id="floor_fold_' + floor + '" href="#" onclick="foldFold(' + floor + ');return false">折叠内容</a>'; } function foldFloorInit(floor) { var content = document.getElementById('floor_content_' + floor); var height = content.offsetHeight; if (height > 768) { var foldBar = document.getElementById('floor_fold_bar_' + floor); foldBar.style.borderTop = '1px solid #BED8EA'; foldBar.style.borderBottom = '1px solid #BED8EA'; foldBar.style.height = '24px'; foldBar.style.textAlign = 'center'; foldFold(floor); } } function foldFloorOnload(floorSize) { var i; for (i=0; i<floorSize; i++) { foldFloorInit(i); } } </script> <script> function atAdd(uid,that) { that.style.color = "#FFA500"; var nr = document.getElementById("content"); nr.value += "@"+uid+","; } </script> <div class="floor_content" id="floor_content_0"> [文章正文.....] </div> <div class="floor_fold_bar" id="floor_fold_bar_0"></div> <script>foldFloorInit(0)</script>
@大尨,弄个框框把内容框住,超过一定字符折叠
小米5s Plus(拉丝深灰)
在林子里,你发帖篇幅大会自动折叠的,不用怎么搞,