Browse Source

字体和颜色换页时保持不变

zhangmin 2 năm trước cách đây
mục cha
commit
586d50c8cd
3 tập tin đã thay đổi với 11 bổ sung5 xóa
  1. 11 3
      bookdetail.html
  2. 0 1
      css/main.css
  3. 0 1
      data/data1.json

+ 11 - 3
bookdetail.html

@@ -236,13 +236,19 @@
 				InitFontSize = 18;
 			}
 			$("p").css('font-size', InitFontSize);
+			$("h4").css('font-size', InitFontSize);
 
 
 			function ReaderBaseFrame(container) { //UI渲染层
 
 				function ParseChapterData(jsonData) { //生成要展示的 html文本
 					let jsonObj = jsonData;
-					let html = "<br/><h4 style='text-align: center'>" + jsonObj.t + "</h4>";
+					CurrFontSize = Util.StorageGetter("font_size");
+					CurrFontSize = parseInt(CurrFontSize);
+					if (!CurrFontSize) {
+						CurrFontSize = 18;
+					}
+					let html = "<br/><h4 style='text-align: center; font-size: " + CurrFontSize + "px'>" + jsonObj.t + "</h4>";
 					if (jsonObj.ct) {
 						let hLevel = 4;
 						for (let i = 0; i < jsonObj.ct.length; i++) {
@@ -254,7 +260,7 @@
 						if (Chapter_id == 0) {
 							html += "<div>" + jsonObj.p[i] + "</div>";
 						} else {
-							html += "<p>" + jsonObj.p[i] + "</p>";
+							html += "<p style='font-size: " + CurrFontSize + "px'>" + jsonObj.p[i] + "</p>";
 						}
 					}
 					html = html.replace("##", )
@@ -558,11 +564,12 @@
 				})
 				//点击 大、小事件
 				Dom.btn_Big.click(function() {
-					if (InitFontSize >= 22) {
+					if (InitFontSize >= 24) {
 						return;
 					}
 					InitFontSize += 1;
 					$("p").css('font-size', InitFontSize);
+					$("h4").css('font-size', InitFontSize);
 					Util.StorageSetter("font_size", InitFontSize);
 				});
 				Dom.btn_Small.click(function() {
@@ -571,6 +578,7 @@
 					}
 					InitFontSize -= 1;
 					$("p").css('font-size', InitFontSize);
+					$("h4").css('font-size', InitFontSize);
 					Util.StorageSetter("font_size", InitFontSize);
 				});
 				//点击夜间&日间 切换模式

+ 0 - 1
css/main.css

@@ -93,7 +93,6 @@ p {
 	display: flex;
 	align-items: center;
 	justify-content: flex-start;
-	background: #e9dfc7;
 }
 
 .top_mulu_return {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 1
data/data1.json


Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác