diff --git a/css/stylesheet.css b/css/stylesheet.css index e13d61a..c458039 100644 --- a/css/stylesheet.css +++ b/css/stylesheet.css @@ -185,6 +185,7 @@ pre { text-shadow: none; overflow: auto; border: solid 1px #f2f2f2; + margin-bottom: 20px; } pre code { diff --git a/index.html b/index.html index 1488fa4..37c220f 100644 --- a/index.html +++ b/index.html @@ -147,8 +147,7 @@

});

And HTML code:

-
    <ul id="pagination-demo" class>="pagination-sm"></ul>
-            
+
    <ul id="pagination-demo" class>="pagination-sm"></ul>

Dynamic total pages number

You can do it with two simple steps. Call destroy method and then initialize it with new options.

-
    var $pagination = $('selector');
+            
    var $pagination = $('selector');
     var defaultOpts = {
-        totalPages: 20
+        totalPages: 20
     };
     $pagination.twbsPagination(defaultOpts);
     $.ajax({
@@ -342,10 +341,7 @@ 

Dynamic total pages number

totalPages: totalPages })); } - }); -
- -

+ });
@@ -366,6 +362,19 @@

Synchronized pagination elements

You can attach multiple paginators to your content and access them via class name. The following example show this case.

+

HTML code:

+
    <ul class="sync-pagination"></ul>
+    <div id="content">Page 1</div>
+    <ul class="sync-pagination pagination-sm"></ul>
+ +

JS code:

+
    $('.sync-pagination').twbsPagination({
+        totalPages: 20,
+        onPageClick: function (evt, page) {
+            $('#content').text('Page ' + page);
+        }
+    });
+
    Page 1
    @@ -386,6 +395,22 @@

    Alternative style pagination (with start and end page numbers)

    flaviusmatis/simplePagination.js plugin.

    +

    JS code:

    +
        $('selector').pagination({
    +        items: 20,
    +        itemOnPage: 8,
    +        currentPage: 1,
    +        cssStyle: '',
    +        prevText: '<span aria-hidden="true">&laquo;</span>',
    +        nextText: '<span aria-hidden="true">&raquo;</span>',
    +        onInit: function () {
    +            // fire first page loading
    +        },
    +        onPageClick: function (page, evt) {
    +            // some code
    +        }
    +    });
    +
    Page 1
      diff --git a/js/main.js b/js/main.js index fe15a64..92802c6 100644 --- a/js/main.js +++ b/js/main.js @@ -50,6 +50,6 @@ $(document).ready(function () { onPageClick: function (page, evt) { $('#alt-style-pagination-content').text('Page ' + page); } - }) + }); });