Bläddra i källkod

summary 限制三行

visuddhinanda 4 år sedan
förälder
incheckning
bc5a82a9cc
2 ändrade filer med 9 tillägg och 2 borttagningar
  1. 2 2
      app/pcdl/index.js
  2. 7 0
      app/pcdl/index.php

+ 2 - 2
app/pcdl/index.js

@@ -40,10 +40,10 @@ function index_load_collect_new() {
 				}
 				html += "</div>";
 				if (iterator.subtitle) {
-					html += "<div>" + iterator.subtitle + "</div>";
+					html += "<div class='subtitle'>" + iterator.subtitle + "</div>";
 				}
 				if (iterator.summary) {
-					html += "<div>" + iterator.summary + "</div>";
+					html += "<div> class='summary'" + iterator.summary + "</div>";
 				}
 
 				html += "<div style='margin-top:1em;'>" + iterator.username.nickname + "</div>";

+ 7 - 0
app/pcdl/index.php

@@ -74,6 +74,13 @@ require_once '../pcdl/html_head.php';
 		.article_right a {
 			color: var(--main-color);
 		}
+		.summary{
+			overflow: hidden;
+			text-overflow: ellipsis;
+			display: -webkit-box;
+			-webkit-line-clamp: 3;
+			-webkit-box-orient: vertical;
+		}
 
 		.title a,
 		.course_right title {