浏览代码

不使用es6; 添加css命名空间

wzl_h
wangzhonglu 2 年前
父节点
当前提交
a9c8d7cb49
共有 7 个文件被更改,包括 18 次插入18 次删除
  1. 2
    2
      css/section_3.css
  2. 2
    2
      css/section_4.css
  3. 8
    8
      js/index.js
  4. 2
    2
      js/section_3.js
  5. 2
    2
      js/section_4.js
  6. 1
    1
      sections/section_3.html
  7. 1
    1
      sections/section_4.html

+ 2
- 2
css/section_3.css 查看文件

@@ -1,9 +1,9 @@
1
-.echarts_result_content {
1
+.section_3 .echarts_result_content {
2 2
   margin-top: 3mm;
3 3
   padding: 3mm;
4 4
   background-color: #fff;
5 5
 }
6
-.echarts_result_content span {
6
+.section_3 .echarts_result_content span {
7 7
   display: inline-block;
8 8
   margin-right: 2mm;
9 9
   width: 2mm;

+ 2
- 2
css/section_4.css 查看文件

@@ -1,9 +1,9 @@
1
-.echarts_result_content {
1
+.section_4 .echarts_result_content {
2 2
   margin-top: 3mm;
3 3
   padding: 3mm;
4 4
   background-color: #fff;
5 5
 }
6
-.echarts_result_content span {
6
+.section_4 .echarts_result_content span {
7 7
   display: inline-block;
8 8
   margin-right: 2mm;
9 9
   width: 2mm;

+ 8
- 8
js/index.js 查看文件

@@ -8,23 +8,23 @@ $(function () {
8 8
     "section_3",
9 9
     "section_4",
10 10
   ];
11
-  $(".pdf_root").html(loadHtmlArr.map(htmlName => {
12
-    return `<div class="${htmlName}_html_root"></div>`;
11
+  $(".pdf_root").html(loadHtmlArr.map(function (htmlName) {
12
+    return "<div class='" + htmlName + "_html_root'></div>";
13 13
   }).join(""));
14
-  loadHtmlArr.forEach(htmlName => {
14
+  loadHtmlArr.forEach(function(htmlName) {
15 15
     if (htmlName === "preface") {
16
-      $(`.${htmlName}_html_root`).data("page-params", JSON.stringify({
17
-        htmlName,
16
+      $("." + htmlName + "_html_root").data("page-params", JSON.stringify({
17
+        htmlName: htmlName,
18 18
         subjectname: "语文",
19 19
         num: 12
20 20
       }));
21 21
     } else if (htmlName === "section_1") {
22
-      $(`.${htmlName}_html_root`).data("page-params", JSON.stringify({
23
-        htmlName,
22
+      $("." + htmlName + "_html_root").data("page-params", JSON.stringify({
23
+        htmlName: htmlName,
24 24
         subjectname: "数学",
25 25
         num: 33
26 26
       }));
27 27
     }
28
-    $(`.${htmlName}_html_root`).load(`../sections/${htmlName}.html`);
28
+    $("." + htmlName + "_html_root").load("../sections/" + htmlName + ".html");
29 29
   });
30 30
 });

+ 2
- 2
js/section_3.js 查看文件

@@ -97,14 +97,14 @@ function initSubjectBadEcharts() {
97 97
             verticalAlign: "bottom",
98 98
             position: "top",
99 99
             distance: 0,
100
-            formatter: `{c}`,
100
+            formatter: "{c}",
101 101
           },
102 102
         },
103 103
         data: series_data,
104 104
       },
105 105
     ],
106 106
   };
107
-  let myEcharts = echarts.init(document.querySelector("#subjectBadEcharts"));
107
+  let myEcharts = echarts.init(document.querySelector(".section_3 #subjectBadEcharts"));
108 108
   myEcharts.clear();
109 109
   myEcharts.setOption(option);
110 110
 }

+ 2
- 2
js/section_4.js 查看文件

@@ -97,14 +97,14 @@ function initSubjectGoodEcharts() {
97 97
             verticalAlign: "bottom",
98 98
             position: "top",
99 99
             distance: 0,
100
-            formatter: `{c}`,
100
+            formatter: "{c}",
101 101
           },
102 102
         },
103 103
         data: series_data,
104 104
       },
105 105
     ],
106 106
   };
107
-  let myEcharts = echarts.init(document.querySelector("#subjectGoodEcharts"));
107
+  let myEcharts = echarts.init(document.querySelector(".section_4 #subjectGoodEcharts"));
108 108
   myEcharts.clear();
109 109
   myEcharts.setOption(option);
110 110
 }

+ 1
- 1
sections/section_3.html 查看文件

@@ -8,7 +8,7 @@
8 8
   <link rel="stylesheet" href="../css/section_3.css">
9 9
 </head>
10 10
 <body>
11
-  <div class="page_root">
11
+  <div class="page_root section_3">
12 12
     <h1 class="section_title_1">第三章 违纪行为分析</h1>
13 13
     <div class="abstract_box">
14 14
       <div class="abstract_left">

+ 1
- 1
sections/section_4.html 查看文件

@@ -8,7 +8,7 @@
8 8
   <link rel="stylesheet" href="../css/section_4.css">
9 9
 </head>
10 10
 <body>
11
-  <div class="page_root">
11
+  <div class="page_root section_4">
12 12
     <h1 class="section_title_1">第四章 优秀试卷分析</h1>
13 13
     <div class="abstract_box">
14 14
       <div class="abstract_left">

正在加载...
取消
保存