In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to achieve amazeUI paging effect through the combination of the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, with a certain reference value, I believe you will have something to gain after reading this article on how to achieve amazeUI paging effect through the combination of front and rear, let's take a look at it.
Front-end implementation
1. Introduce paginator.js
(function ($) {$.fn.paginator = function (options) {/ / this points to the current selector var config = {url: ", pageParent:", totalBars:-1, limit:-1, offset: 1 Callback: null} / / merge parameter var opts = $.extend (config, options) Opts.totalBars = Math.ceil (opts.totalBars / opts.limit); / / calculate the total number of buttons / / get the offset parameter var queryString = function (url) {var offset = (url.split ("?) [1]). Split (" = ") [1]; return parseInt (offset) } / / ajax core method Data operation var ajaxCore = function (offset, fn) {$.ajax ({"url": opts.url, "data": {"offset": offset, "limit": opts.limit}, "dataType": "JSON") for paging "method": "POST", "success": fn}) } / / reassemble the paging button var pageCore = function (offset) {if (opts.offset = = offset) {return;} / / if it's the current page, you don't have to do anything! Else {ajaxCore (offset, opts.callback); $(opts.pageParent). Empty (); / / otherwise, clear all nodes and re-insert a new paging button into DOM var output = "; var nextBar = offset = = opts.totalBars?" »: "»" Var preBar = offset = = 1? "«": "«"; / / assemble the previous node and next node if (opts.totalBars > 7) {if (offset < 5) {output + = preBar; for (var I = 1) I = 5 & & offset opts.totalBars-4 & & offset = 0; if (opts.totalBars-j = = offset) {output + = "" + (opts.totalBars-j) + ";} else {output + ="+ (opts.totalBars-j) +" }} output + = nextBar;} else {console.log ("paging data error!") ; return;}} else {output + = preBar; for (var I = 1; I 1? "»": "»"; / / Last page var output = "1"; if (opts.totalBars
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.