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