Skip to content

Instantly share code, notes, and snippets.

View zhnoah's full-sized avatar

赵虎 zhnoah

  • Desunsoft
  • Nanjing·China
View GitHub Profile
@kottenator
kottenator / simple-pagination.js
Created July 13, 2015 20:44
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;