123456789101112131415161718192021222324252627282930 |
- $(function () {
- let loadHtmlArr = [
- "cover",
- // "catalog",
- "preface",
- "section_1",
- "section_2",
- "section_3",
- "section_4",
- ];
- $(".pdf_root").html(loadHtmlArr.map(htmlName => {
- return `<div class="${htmlName}_html_root"></div>`;
- }).join(""));
- loadHtmlArr.forEach(htmlName => {
- if (htmlName === "preface") {
- $(`.${htmlName}_html_root`).data("page-params", JSON.stringify({
- htmlName,
- subjectname: "语文",
- num: 12
- }));
- } else if (htmlName === "section_1") {
- $(`.${htmlName}_html_root`).data("page-params", JSON.stringify({
- htmlName,
- subjectname: "数学",
- num: 33
- }));
- }
- $(`.${htmlName}_html_root`).load(`../sections/${htmlName}.html`);
- });
- });
|