用把手/骨干分页

时间:2013-12-18 01:41:25

标签: javascript twitter-bootstrap backbone.js pagination

我想使用Handlebars实现简单的分页。我正在使用bootstrap 3.这就是我所拥有的:

HTML

<div class = "categories-block">
 {{#each category}}
  <div class = "category">
  <div class = "item">
    <h2>{{itemname}}</h2>
    <a href = "#" class = "link">View Category</a>
    <p class = "item-desc">{{itemndesc}}</p>
  </div>
  </div>
 {{/each}}
</div>

<div class="pagination">
   <li><a href="#">Previous</a></li>
   <li><a href="#">1</a></li>
   <li><a href="#">Next</a></li>
</div>

MODEL

var categorymodel = Backbone.Model.extend({
url: "http://localhost/category.json",
  defaults: {

  }
});

现在,我从模型中获得的所有内容都显示在那里。如何分页,在一个页面中显示5个项目。 提前致谢

0 个答案:

没有答案