dpql57753 2014-12-14 17:18
浏览 46
已采纳

返回上一页 - 移动HTML

I'm building an app with Ratchet, and in the navbar I'd like to use BACK & NEXT buttons.

Now, I'm not using Ratchet's built-in Push.js due to structural constraints.

Is there a way to create a page-independent BACK & NEXT buttons that look for the corresponding pages in my history?

  • 写回答

1条回答 默认 最新

  • dongshun1884 2015-02-05 05:33
    关注

    You can use the History API

       <header class="bar bar-nav">
          <a class="btn btn-link btn-nav pull-left" onclick="window.history.back()">
            <span class="icon icon-left-nav" ></span>
            Left
          </a>
          <a class="btn btn-link btn-nav pull-right" onclick="window.history.forward()">
            Right
            <span class="icon icon-right-nav" ></span>
          </a>
          <h1 class="title">Title</h1>
        </header>
    

    jsfiddle

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?