问题原因:

gitbook在build生成html以后左侧菜单的超链接不能点击了, 主要是gitbook不在支持本地模式了

既然不能点击, 那就自己修改一下, 添加个js点击事件, 让页面跳转即可

使用方法:

在每个md文件中添加以下代码即可

<script type="text/javascript">
window.addEventListener("load", function() {
  var click_handle = function() {
    if (this.href.substr(-5) == ".html") {
      location.href = this.href;
    } else {
      location.href = "./index.html";
    }
  };
  var as = document.querySelectorAll(".chapter a, .navigation-prev, .navigation-next");
  for (var i = 0; i < as.length; i++) {
    as[i].addEventListener("click", click_handle, true);
    as[i].title = as[i].innerText;
  }
});
</script>

文章来源http://www.dotcoo.com/gitbook-link

相关文章:

  • 2021-06-26
  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-17
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-11
  • 2022-12-23
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案