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>
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
}));
}
- });
-
-
-
+ });
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);
+ }
+ });
+
JS code:
+ $('selector').pagination({
+ items: 20,
+ itemOnPage: 8,
+ currentPage: 1,
+ cssStyle: '',
+ prevText: '<span aria-hidden="true">«</span>',
+ nextText: '<span aria-hidden="true">»</span>',
+ onInit: function () {
+ // fire first page loading
+ },
+ onPageClick: function (page, evt) {
+ // some code
+ }
+ });
+