Bootstrap分页内容

时间:2015-05-27 09:53:39

标签: javascript jquery twitter-bootstrap pagination twitter-bootstrap-2

我正在尝试使用bootstrap分页插件,但我对如何使用此功能显示内容感到有点迷茫。代码将显示“page”,后跟页码。谁能告诉我如何在段落中添加文字?请参阅以下代码:

<p id="content"></p>
<p id="pagination-here"></p>

<script>
$('#pagination-here').bootpag({
    total: 7, // total pages 
    page: 1, // default page 
    maxVisible: 5, // visible pagination 
    leaps: true // next/prev leaps through maxVisible 
}).on("page", function(event, num) {
    $("#content").html("Page " + num); // or some ajax content loading... 
    // ... after content load -> change total to 10 
    $(this).bootpag({
        total: 10,
        maxVisible: 10
    });
});
</script>