|
|
@@ -33,9 +33,9 @@
|
|
|
<body>
|
|
|
<div>
|
|
|
<!-- 中间点击层 -->
|
|
|
- <div class="m-artical-action">
|
|
|
+ <!-- <div class="m-artical-action">
|
|
|
<div class="m-artical-action-mid" id="action_mid"></div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
<!-- 顶部导航 -->
|
|
|
<div class="nav-top colorStyle bgStyle" id="nav_top" style="display: none;">
|
|
|
<div class="nav_container">
|
|
|
@@ -54,13 +54,15 @@
|
|
|
</div>
|
|
|
<div class="top_right"></div>
|
|
|
</header>
|
|
|
- <div class="container">
|
|
|
- <div class="Content">
|
|
|
- <!-- 内容动态加载 -->
|
|
|
- </div>
|
|
|
- <div class="page_btn">
|
|
|
- <button class="btn-prev colorStyle bgStyle" id="btn_prev">上一章</button>
|
|
|
- <button class="btn-next colorStyle bgStyle" id="btn_next">下一章</button>
|
|
|
+ <div id="upperElement" style="height: 100vh;width: 100vw;">
|
|
|
+ <div class="container">
|
|
|
+ <div class="Content">
|
|
|
+ <!-- 内容动态加载 -->
|
|
|
+ </div>
|
|
|
+ <div class="page_btn">
|
|
|
+ <button class="btn-prev colorStyle bgStyle" id="btn_prev">上一章</button>
|
|
|
+ <button class="btn-next colorStyle bgStyle" id="btn_next">下一章</button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 底部导航栏 -->
|
|
|
@@ -248,14 +250,14 @@
|
|
|
}
|
|
|
}
|
|
|
// 封面-0,扉页-1 不需要展示章节名称
|
|
|
- if(!['0','1'].includes(Chapter_id+'')){
|
|
|
+ if (!['0', '1'].includes(Chapter_id + '')) {
|
|
|
html += `<br/><br/><br/>`;
|
|
|
if (jsonObj.ct && jsonObj.ct !== jsonObj.t) {
|
|
|
html += `<h3 style=font-size:${fontSizeAdd6};color:${fontColor}">${jsonObj.ct}</h3><br/>`;
|
|
|
}
|
|
|
html += `<h4 style=font-size:${fontSizeAdd6};color:${fontColor}">${jsonObj.t}</h4>`;
|
|
|
}
|
|
|
- //正文内容
|
|
|
+ //正文内容
|
|
|
for (let i = 0; i < jsonObj.p.length; i++) {
|
|
|
if (Chapter_id == 0) {
|
|
|
html += "<div>" + jsonObj.p[i] + "</div>";
|
|
|
@@ -271,10 +273,10 @@
|
|
|
`<div style="margin-bottom:1.25rem;">${jsonObj.p[i]}</div>`;
|
|
|
} else if (/^&tableTemp.*/.test(jsonObj.p[i])) {
|
|
|
let tableTemp = jsonObj.p[i].split("-")[1];
|
|
|
- if(!tableTemp){
|
|
|
+ if (!tableTemp) {
|
|
|
continue;
|
|
|
}
|
|
|
- if(!jsonObj[tableTemp]){
|
|
|
+ if (!jsonObj[tableTemp]) {
|
|
|
continue;
|
|
|
}
|
|
|
let tableObj = jsonObj[tableTemp];
|
|
|
@@ -543,13 +545,44 @@
|
|
|
|
|
|
function EventHandler() { //业务事件处理层
|
|
|
//点击主体中间事件
|
|
|
- $("#action_mid").click(function() {
|
|
|
- if (Dom.nav_top.css('display') == "none") {
|
|
|
- actNavDialog(true)
|
|
|
+ // $("#action_mid").click(function() {
|
|
|
+ // if (Dom.nav_top.css('display') == "none") {
|
|
|
+ // actNavDialog(true)
|
|
|
+ // } else {
|
|
|
+ // actAllDialog(false)
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+
|
|
|
+ //=============
|
|
|
+ let upperElement = document.getElementById('upperElement')
|
|
|
+ upperElement.addEventListener('click', function(event) {
|
|
|
+ var target = event.target;
|
|
|
+ if (['btn_next', 'btn_prev'].includes(target.id)) {
|
|
|
+
|
|
|
} else {
|
|
|
- actAllDialog(false)
|
|
|
+ if (Dom.nav_top.css('display') == "none") {
|
|
|
+ actNavDialog(true)
|
|
|
+ } else {
|
|
|
+ actAllDialog(false)
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ // 判断事件触发的源元素是上层元素还是下层元素
|
|
|
+ // if (target.id === 'lowerElement') {
|
|
|
+ // // 如果是下层元素,则触发下层元素的事件
|
|
|
+ // console.log('下层元素的事件被触发');
|
|
|
+ // // 实现下层元素的事件处理逻辑
|
|
|
+ // } else {
|
|
|
+ // // 如果是上层元素,则触发上层元素的事件
|
|
|
+ // console.log('上层元素的事件被触发');
|
|
|
+ // // 实现上层元素的事件处理逻辑
|
|
|
+ // }
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //=============
|
|
|
//点击返回事件
|
|
|
$(".nav_back_book").click(function() {
|
|
|
Chapter_id = parseInt(Chapter_id);
|