bootstrap分页插件--Bootstrap Paginator的使用&AJAX版备份(可单独使用)
html部分:
1 2 | < ul class="pagination"></ ul > <!--bootstrap3版本用ul包裹--> < div class="pagination"></ div > <!--bootstrap2版本用div包裹--> |
刷新页面版Bootstrap Paginator:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | var options = { currentPage: '<%= currentPage %>' ||1, //设置当前页,默认起始页为第一页 totalPages: '<%= totalPages %>' , //总页数 numberOfPages:5, //设置控件显示的页码数,跟后台计算出来的总页数没多大关系 bootstrapMajorVersion:3, //如果是bootstrap3版本需要加此标识,并且设置包含分页内容的DOM元素为UL,如果是bootstrap2版本,则DOM包含元素是DIV useBootstrapTooltip: 'true' , //是否显示tip提示框 pageUrl: function (type,page, current){ return '?gotoPage=' +page //为每个页码设置url访问请求链接,page为页码数 }, itemTexts: function (type,page, current){ //文字翻译 switch (type) { case "first" : return "首页" ; case "prev" : return "上一页" ; case "next" : return "下一页" ; case "last" : return "尾页" ; case "page" : return page; } } } $( '.pagination' ).bootstrapPaginator(options); |
AJAX版Bootstrap Paginator:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | function AjaxPaginator(obj) { $.ajax({ type: 'POST' , url: '/getData' , dataType: 'JSON' , /*success*/ complete: function (data) { var currentPage=data.currentPage|1; var totalPages=data.totalPages|10; var options = { currentPage: currentPage, //当前页 totalPages: totalPages, //总页数 numberOfPages: 5, //设置控件显示的页码数 bootstrapMajorVersion: 3, //如果是bootstrap3版本需要加此标识,并且设置包含分页内容的DOM元素为UL,如果是bootstrap2版本,则DOM包含元素是DIV useBootstrapTooltip: false , //是否显示tip提示框 itemTexts: function (type,page, current){ //文字翻译 switch (type) { case "first" : return "首页" ; case "prev" : return "上一页" ; case "next" : return "下一页" ; case "last" : return "尾页" ; case "page" : return page; } }, onPageClicked: function (event, originalEvent, type, page) { $.ajax({ url: '/getData?CurrentPage=' +page, //点击分页提交当前页码 success: function (data){ if (data!= null ){ //DOM操作 } } }) } } obj.bootstrapPaginator(options); } }) } AjaxPaginator($( '.pagination' )); |
AJAX版Bootstrap Paginator封装版:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | 封装: var commonFn={}; commonFn.setAjaxPaginator = function (paginatorSelector, data, option) { var totals = data.count; //总条数 var pageSize = option.pageSize; //每页条数 var totalPages = 1; if (totals != 0) { if (totals % pageSize == 0) { totalPages = totals / pageSize; } else { totalPages = Math.ceil(totals / pageSize); } } if (totalPages > 1) { //当总页数大于1时生成显示分页否则不显示分页 commonFn.buildAjaxPaginator(paginatorSelector, $.extend(option, {totalPages: totalPages})) } } commonFn.buildAjaxPaginator = function (paginatorSelector, option) { var _option = { currentPage: 1, //当前页 totalPages: 1, //总页数 numberOfPages: 5, //设置控件显示的页码数 bootstrapMajorVersion: 3, //如果是bootstrap3版本需要加此标识,并且设置包含分页内容的DOM元素为UL,如果是bootstrap2版本,则DOM包含元素是DIV useBootstrapTooltip: false , //是否显示tip提示框 itemTexts: function (type, page, current) { //文字翻译 switch (type) { case "first" : return "首页" ; case "prev" : return "上一页" ; case "next" : return "下一页" ; case "last" : return "尾页" ; case "page" : return page; } }, onPageClicked: function (event, originalEvent, type, page, pageSize) { } }; $.extend(_option, option); paginatorSelector.bootstrapPaginator(_option); } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 调用: //HTML <span class = "query_btn" >查询</span> <ul class = "pagination" ></ul> <div class = "loadPageDataSelector" ></div> //JS //点击查询按钮进行查询 $( '.query_btn' ).click( function (){ queryOperate(1,10) }) var defaultPagination={ "page" :1, "pageSize" :10}; //默认配置的当前页和每页显示条数 //重写点击分页执行的方法 传递当前点击的页面 function onPageClick(event, originalEvent, type, page) { //点击分页插件时传递的当前页和每页显示条数 queryOperate(page,defaultPagination.pageSize); }; //查询操作 function queryOperate(page,pageSize){ var queryData={ "name" : "leyi" }; //其他的表单提交值 $.extend(queryData, {page: page||1, pageSize: pageSize || 10}); //提交查询操作的参数 $.ajax({ data:queryData, url: 'xxx' , /*success*/ complete: function (data){ var data={data: "返回的数据内容" ,count:100 /*假设总条数100*/ } //生成分页 commonFn.setAjaxPaginator($( '.pagination' ),data,{currentPage: queryData.page, pageSize:queryData.pageSize,onPageClicked: onPageClick}); //DOM操作显示装载的数据内容 $( '.loadPageDataSelector' ).html(data.data+queryData.page) } }) } |
如果不使用bootstrap只是单独使用该分页插件需要拷贝下面的样式表
自定义样式表:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | .pagination { display : inline- block ; padding-left : 0 ; border-radius: 4px ; float : right ; } .pagination > li { display : inline ; } .pagination > li > a, .pagination > li > span { position : relative ; float : left ; padding : 6px 12px ; margin-left : -1px ; line-height : 1.428571429 ; text-decoration : none ; background-color : #ffffff ; border : 1px solid #dddddd ; border-radius: 4px ; margin-right : 10px ; cursor : pointer } .pagination > li:first-child > a, .pagination > li:first-child > span { margin-left : 0 ; border-bottom-left-radius: 4px ; border-top-left-radius: 4px ; } .pagination > li:last-child > a, .pagination > li:last-child > span { border-top-right-radius: 4px ; border-bottom-right-radius: 4px ; } .pagination > li > a:hover, .pagination > li > span:hover, .pagination > li > a:focus, .pagination > li > span:focus { border-color : #e82100 ; } .pagination > .active > a, .pagination > .active > span, .pagination > .active > a:hover, .pagination > .active > span:hover, .pagination > .active > a:focus, .pagination > .active > span:focus { z-index : 2 ; color : #ffffff ; cursor : default ; background-color : #e82100 ; border-color : #e82100 ; } .pagination > .disabled > span, .pagination > .disabled > a, .pagination > .disabled > a:hover, .pagination > .disabled > a:focus { color : #999999 ; cursor : not-allowed; background-color : #ffffff ; border-color : #dddddd ; } .pagination-sm > li > a, .pagination-sm > li > span { padding : 5px 10px ; font-size : 12px ; } .pagination-sm > li:first-child > a, .pagination-sm > li:first-child > span { border-bottom-left-radius: 3px ; border-top-left-radius: 3px ; } .pagination-sm > li:last-child > a, .pagination-sm > li:last-child > span { border-top-right-radius: 3px ; border-bottom-right-radius: 3px ; } |
bootstrap-paginator源码备份:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | /** * bootstrap-paginator.js v0.5 * -- * Copyright 2013 Yun Lai <lyonlai1984@gmail.com> * -- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ ( function ($) { "use strict" ; // jshint ;_; /* Paginator PUBLIC CLASS DEFINITION * ================================= */ /** * Boostrap Paginator Constructor * * @param element element of the paginator * @param options the options to config the paginator * * */ var BootstrapPaginator = function (element, options) { this .init(element, options); }, old = null ; BootstrapPaginator.prototype = { /** * Initialization function of the paginator, accepting an element and the options as parameters * * @param element element of the paginator * @param options the options to config the paginator * * */ init: function (element, options) { this .$element = $(element); var version = (options && options.bootstrapMajorVersion) ? options.bootstrapMajorVersion : $.fn.bootstrapPaginator.defaults.bootstrapMajorVersion, id = this .$element.attr( "id" ); if (version === 2 && ! this .$element.is( "div" )) { throw "in Bootstrap version 2 the pagination must be a div element. Or if you are using Bootstrap pagination 3. Please specify it in bootstrapMajorVersion in the option" ; } else if (version > 2 && ! this .$element.is( "ul" )) { throw "in Bootstrap version 3 the pagination root item must be an ul element." } this .currentPage = 1; this .lastPage = 1; this .setOptions(options); this .initialized = true ; }, /** * Update the properties of the paginator element * * @param options options to config the paginator * */ setOptions: function (options) { this .options = $.extend({}, ( this .options || $.fn.bootstrapPaginator.defaults), options); this .totalPages = parseInt( this .options.totalPages, 10); //setup the total pages property. this .numberOfPages = parseInt( this .options.numberOfPages, 10); //setup the numberOfPages to be shown //move the set current page after the setting of total pages. otherwise it will cause out of page exception. if (options && typeof (options.currentPage) !== 'undefined' ) { this .setCurrentPage(options.currentPage); } this .listen(); //render the paginator this .render(); if (! this .initialized && this .lastPage !== this .currentPage) { this .$element.trigger( "page-changed" , [ this .lastPage, this .currentPage]); } }, /** * Sets up the events listeners. Currently the pageclicked and pagechanged events are linked if available. * * */ listen: function () { this .$element.off( "page-clicked" ); this .$element.off( "page-changed" ); // unload the events for the element if ( typeof ( this .options.onPageClicked) === "function" ) { this .$element.bind( "page-clicked" , this .options.onPageClicked); } if ( typeof ( this .options.onPageChanged) === "function" ) { this .$element.on( "page-changed" , this .options.onPageChanged); } this .$element.bind( "page-clicked" , this .onPageClicked); }, /** * * Destroys the paginator element, it unload the event first, then empty the content inside. * * */ destroy: function () { this .$element.off( "page-clicked" ); this .$element.off( "page-changed" ); this .$element.removeData( 'bootstrapPaginator' ); this .$element.empty(); }, /** * Shows the page * * */ show: function (page) { this .setCurrentPage(page); this .render(); if ( this .lastPage !== this .currentPage) { this .$element.trigger( "page-changed" , [ this .lastPage, this .currentPage]); } }, /** * Shows the next page * * */ showNext: function () { var pages = this .getPages(); if (pages.next) { this .show(pages.next); } }, /** * Shows the previous page * * */ showPrevious: function () { var pages = this .getPages(); if (pages.prev) { this .show(pages.prev); } }, /** * Shows the first page * * */ showFirst: function () { var pages = this .getPages(); if (pages.first) { this .show(pages.first); } }, /** * Shows the last page * * */ showLast: function () { var pages = this .getPages(); if (pages.last) { this .show(pages.last); } }, /** * Internal on page item click handler, when the page item is clicked, change the current page to the corresponding page and * trigger the pageclick event for the listeners. * * * */ onPageItemClicked: function (event) { var type = event.data.type, page = event.data.page; this .$element.trigger( "page-clicked" , [event, type, page]); }, onPageClicked: function (event, originalEvent, type, page) { //show the corresponding page and retrieve the newly built item related to the page clicked before for the event return var currentTarget = $(event.currentTarget); switch (type) { case "first" : currentTarget.bootstrapPaginator( "showFirst" ); break ; case "prev" : currentTarget.bootstrapPaginator( "showPrevious" ); break ; case "next" : currentTarget.bootstrapPaginator( "showNext" ); break ; case "last" : currentTarget.bootstrapPaginator( "showLast" ); break ; case "page" : currentTarget.bootstrapPaginator( "show" , page); break ; } }, /** * Renders the paginator according to the internal properties and the settings. * * * */ render: function () { //fetch the container class and add them to the container var containerClass = this .getValueFromOption( this .options.containerClass, this .$element), size = this .options.size || "normal" , alignment = this .options.alignment || "left" , pages = this .getPages(), listContainer = this .options.bootstrapMajorVersion === 2 ? $( "<ul></ul>" ) : this .$element, listContainerClass = this .options.bootstrapMajorVersion === 2 ? this .getValueFromOption( this .options.listContainerClass, listContainer) : null , first = null , prev = null , next = null , last = null , p = null , i = 0; this .$element.prop( "class" , "" ); this .$element.addClass( "pagination" ); switch (size.toLowerCase()) { case "large" : case "small" : case "mini" : this .$element.addClass($.fn.bootstrapPaginator.sizeArray[ this .options.bootstrapMajorVersion][size.toLowerCase()]); break ; default : break ; } if ( this .options.bootstrapMajorVersion === 2) { switch (alignment.toLowerCase()) { case "center" : this .$element.addClass( "pagination-centered" ); break ; case "right" : this .$element.addClass( "pagination-right" ); break ; default : break ; } } this .$element.addClass(containerClass); //empty the outter most container then add the listContainer inside. this .$element.empty(); if ( this .options.bootstrapMajorVersion === 2) { this .$element.append(listContainer); listContainer.addClass(listContainerClass); } //update the page element reference this .pageRef = []; if (pages.first) { //if the there is first page element first = this .buildPageItem( "first" , pages.first); if (first) { listContainer.append(first); } } if (pages.prev) { //if the there is previous page element prev = this .buildPageItem( "prev" , pages.prev); if (prev) { listContainer.append(prev); } } for (i = 0; i < pages.length; i = i + 1) { //fill the numeric pages. p = this .buildPageItem( "page" , pages[i]); if (p) { listContainer.append(p); } } if (pages.next) { //if there is next page next = this .buildPageItem( "next" , pages.next); if (next) { listContainer.append(next); } } if (pages.last) { //if there is last page last = this .buildPageItem( "last" , pages.last); if (last) { listContainer.append(last); } } }, /** * * Creates a page item base on the type and page number given. * * @param page page number * @param type type of the page, whether it is the first, prev, page, next, last * * @return Object the constructed page element * */ buildPageItem: function (type, page) { var itemContainer = $( "<li></li>" ), //creates the item container itemContent = $( "<a></a>" ), //creates the item content text = "" , title = "" , itemContainerClass = this .options.itemContainerClass(type, page, this .currentPage), itemContentClass = this .getValueFromOption( this .options.itemContentClass, type, page, this .currentPage), tooltipOpts = null ; switch (type) { case "first" : if (! this .getValueFromOption( this .options.shouldShowPage, type, page, this .currentPage)) { return ; } text = this .options.itemTexts(type, page, this .currentPage); title = this .options.tooltipTitles(type, page, this .currentPage); break ; case "last" : if (! this .getValueFromOption( this .options.shouldShowPage, type, page, this .currentPage)) { return ; } text = this .options.itemTexts(type, page, this .currentPage); title = this .options.tooltipTitles(type, page, this .currentPage); break ; case "prev" : if (! this .getValueFromOption( this .options.shouldShowPage, type, page, this .currentPage)) { return ; } text = this .options.itemTexts(type, page, this .currentPage); title = this .options.tooltipTitles(type, page, this .currentPage); break ; case "next" : if (! this .getValueFromOption( this .options.shouldShowPage, type, page, this .currentPage)) { return ; } text = this .options.itemTexts(type, page, this .currentPage); title = this .options.tooltipTitles(type, page, this .currentPage); break ; case "page" : if (! this .getValueFromOption( this .options.shouldShowPage, type, page, this .currentPage)) { return ; } text = this .options.itemTexts(type, page, this .currentPage); title = this .options.tooltipTitles(type, page, this .currentPage); break ; } itemContainer.addClass(itemContainerClass).append(itemContent); itemContent.addClass(itemContentClass).html(text).on( "click" , null , {type: type, page: page}, $.proxy( this .onPageItemClicked, this )); if ( this .options.pageUrl) { itemContent.attr( "href" , this .getValueFromOption( this .options.pageUrl, type, page, this .currentPage)); } if ( this .options.useBootstrapTooltip) { tooltipOpts = $.extend({}, this .options.bootstrapTooltipOptions, {title: title}); itemContent.tooltip(tooltipOpts); } else { itemContent.attr( "title" , title); } return itemContainer; }, setCurrentPage: function (page) { if (page > this .totalPages || page < 1) { // if the current page is out of range, throw exception. throw "Page out of range" ; } this .lastPage = this .currentPage; this .currentPage = parseInt(page, 10); }, /** * Gets an array that represents the current status of the page object. Numeric pages can be access via array mode. length attributes describes how many numeric pages are there. First, previous, next and last page can be accessed via attributes first, prev, next and last. Current attribute marks the current page within the pages. * * @return object output objects that has first, prev, next, last and also the number of pages in between. * */ getPages: function () { var totalPages = this .totalPages, // get or calculate the total pages via the total records pageStart = ( this .currentPage % this .numberOfPages === 0) ? (parseInt( this .currentPage / this .numberOfPages, 10) - 1) * this .numberOfPages + 1 : parseInt( this .currentPage / this .numberOfPages, 10) * this .numberOfPages + 1, //calculates the start page. output = [], i = 0, counter = 0; pageStart = pageStart < 1 ? 1 : pageStart; //check the range of the page start to see if its less than 1. for (i = pageStart, counter = 0; counter < this .numberOfPages && i <= totalPages; i = i + 1, counter = counter + 1) { //fill the pages output.push(i); } output.first = 1; //add the first when the current page leaves the 1st page. if ( this .currentPage > 1) { // add the previous when the current page leaves the 1st page output.prev = this .currentPage - 1; } else { output.prev = 1; } if ( this .currentPage < totalPages) { // add the next page when the current page doesn't reach the last page output.next = this .currentPage + 1; } else { output.next = totalPages; } output.last = totalPages; // add the last page when the current page doesn't reach the last page output.current = this .currentPage; //mark the current page. output.total = totalPages; output.numberOfPages = this .options.numberOfPages; return output; }, /** * Gets the value from the options, this is made to handle the situation where value is the return value of a function. * * @return mixed value that depends on the type of parameters, if the given parameter is a function, then the evaluated result is returned. Otherwise the parameter itself will get returned. * */ getValueFromOption: function (value) { var output = null , args = Array.prototype.slice.call(arguments, 1); if ( typeof value === 'function' ) { output = value.apply( this , args); } else { output = value; } return output; } }; /* TYPEAHEAD PLUGIN DEFINITION * =========================== */ old = $.fn.bootstrapPaginator; $.fn.bootstrapPaginator = function (option) { var args = arguments, result = null ; $( this ).each( function (index, item) { var $ this = $(item), data = $ this .data( 'bootstrapPaginator' ), options = ( typeof option !== 'object' ) ? null : option; if (!data) { data = new BootstrapPaginator( this , options); $ this = $(data.$element); $ this .data( 'bootstrapPaginator' , data); return ; } if ( typeof option === 'string' ) { if (data[option]) { result = data[option].apply(data, Array.prototype.slice.call(args, 1)); } else { throw "Method " + option + " does not exist" ; } } else { result = data.setOptions(option); } }); return result; }; $.fn.bootstrapPaginator.sizeArray = { "2" : { "large" : "pagination-large" , "small" : "pagination-small" , "mini" : "pagination-mini" }, "3" : { "large" : "pagination-lg" , "small" : "pagination-sm" , "mini" : "" } }; $.fn.bootstrapPaginator.defaults = { containerClass: "" , size: "normal" , alignment: "left" , bootstrapMajorVersion: 2, listContainerClass: "" , itemContainerClass: function (type, page, current) { return (page === current) ? "active" : "" ; }, itemContentClass: function (type, page, current) { return "" ; }, currentPage: 1, numberOfPages: 5, totalPages: 1, pageUrl: function (type, page, current) { return null ; }, onPageClicked: null , onPageChanged: null , useBootstrapTooltip: false , shouldShowPage: function (type, page, current) { var result = true ; switch (type) { case "first" : result = (current !== 1); break ; case "prev" : result = (current !== 1); break ; case "next" : result = (current !== this .totalPages); break ; case "last" : result = (current !== this .totalPages); break ; case "page" : result = true ; break ; } return result; }, itemTexts: function (type, page, current) { switch (type) { case "first" : return "<<" ; case "prev" : return "<" ; case "next" : return ">" ; case "last" : return ">>" ; case "page" : return page; } }, tooltipTitles: function (type, page, current) { switch (type) { case "first" : return "Go to first page" ; case "prev" : return "Go to previous page" ; case "next" : return "Go to next page" ; case "last" : return "Go to last page" ; case "page" : return (page === current) ? "Current page is " + page : "Go to page " + page; } }, bootstrapTooltipOptions: { animation: true , html: true , placement: 'top' , selector: false , title: "" , container: false } }; $.fn.bootstrapPaginator.Constructor = BootstrapPaginator; }(window.jQuery)); |
参考资料:http://m.oschina.net/blog/204587 http://www.tuicool.com/articles/ZRfuyi
分类:
Javascript
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
· 现代计算机视觉入门之:什么是图片特征编码
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· Spring AI + Ollama 实现 deepseek-r1 的API服务和调用
· 数据库服务器 SQL Server 版本升级公告
· C#/.NET/.NET Core技术前沿周刊 | 第 23 期(2025年1.20-1.26)
· 程序员常用高效实用工具推荐,办公效率提升利器!