婷婷综合国产,91蜜桃婷婷狠狠久久综合9色 ,九九九九九精品,国产综合av

主頁 > 知識庫 > ASP 數(shù)字分頁效果代碼

ASP 數(shù)字分頁效果代碼

熱門標簽:不封卡外呼系統(tǒng)一般多少錢 電銷機器人一個多少錢 鄭州語音電銷機器人官網(wǎng) 北京大興區(qū)地圖標注 地圖標注中心多少錢注冊 重慶外呼電銷系統(tǒng)費用 濰坊呼叫中心外呼系統(tǒng)供應商 地圖標注不完整被罰款 微信地圖標注有什么用
最近網(wǎng)站改版正好發(fā)現(xiàn)原來的分頁不帶數(shù)字的,只有首頁 上頁 下頁 末頁 然后是select的跳轉(zhuǎn),都是以前比較流行的,而現(xiàn)在比較流行的是數(shù)字分頁在中間,正好研究并分享下,需要的朋友可以參考下

效果:



國外的核心代碼:

復制代碼 代碼如下:

%
 'digg style pagination script in asp.. written by Moazam... http://www.moazam.com/2007/03/30/asp-digg-style-pagination-script/

 function getPaginationString(page, totalitems, limit, adjacents, targetpage) 
  'defaults
  if not isnumeric(adjacents) then adjacents = 1 end if
  if not isnumeric(limit) then  limit = 15 end if
  if not isnumeric(page) then page = 1 end if
  if targetpage = "" then targetpage = "/" end if
  margin = ""
  padding=""
  'other vars
  prev = page - 1         'previous page is page - 1
  nextPage = page + 1         'nextPage page is page + 1
  lastpage = Ceil(totalitems , limit)    'lastpage is = total items / items per page, rounded up.
  lpm1 = lastpage - 1        'last page minus 1
  ' Now we apply our rules and draw the pagination object.
  ' We're actually saving the code to a variable in case we want to draw it more than once.

  pagination = ""
  if lastpage > 1 then

   pagination = pagination "div class=""pagination"""
   if margin > "" OR padding > "" then
    pagination = pagination   " style="""
    if margin > "" then
     pagination = pagination   "margin: margin"
    end if
    if padding > "" then
     pagination = pagination   "padding: padding"
    end if
    pagination = pagination   """"
   end if
   pagination = pagination   ">"

   'previous button
   if page > 1 then
    pagination = pagination   "a href="""targetpage"page="prev""">Prev/a>"
   else
    pagination = pagination   "span class=""disabled"">Prev/span>" 
   end if
   'pages 
   if lastpage 7 + (adjacents * 2) then 'not enough pages to bother breaking it up

    for counter = 1 to lastpage

     if counter = page then
      pagination = pagination   "span class=""current"">"counter"/span>"
     else
      pagination = pagination   "a href="""targetpage"""page="counter""">"counter"/a>"
     end if
    next 
   elseif lastpage >= 7 + (adjacents * 2) then 'enough pages to hide some
    'close to beginning only hide later pages
    if page 1 + (adjacents * 3) then 
     for counter = 1 to (4 + (adjacents * 2))-1
      if counter = page then
       pagination = pagination   "span class=""current"">"counter"/span>"
      else
       pagination = pagination   "a href="""targetpage"page="counter""">"counter"/a>"
      end if   
     next
     pagination = pagination   "..."
     pagination = pagination   "a href="""targetpage"""page="lpm1""">"lpm1"/a>"
     pagination = pagination   "a href="""targetpage"""page="lastpage""">"lastpage"/a>"  
    'in middle hide some front and some back
    elseif lastpage - (adjacents * 2) > page AND page > (adjacents * 2) then
     pagination = pagination   "a href="""targetpage"page=1"">1/a>"
     pagination = pagination   "a href="""targetpage"page=2"">2/a>"
     pagination = pagination   "..."
     for counter = (page - adjacents) to (page + adjacents)
      if counter = page then
       pagination = pagination   "span class=""current"">"counter"/span>"
      else
       pagination = pagination   "a href="""targetpage"page="counter""">"counter"/a>"
      end if
     next
     pagination = pagination   "..."
     pagination = pagination   "a href="""targetpage"page="lpm1""">"lpm1"/a>"
     pagination = pagination   "a href="""targetpage"page="lastpage""">"lastpage"/a>"  
    'close to end only hide early pages
    else
     pagination = pagination   "a href="""targetpage"page=1"">1/a>"
     pagination = pagination   "a href="""targetpage"page=2"">2/a>"
     pagination = pagination   "..."
     for counter = (lastpage - (1 + (adjacents * 3))) To lastpage
      if counter = page then
       pagination = pagination   "span class=""current"">"counter"/span>"
      else
       pagination = pagination   "a href="""targetpage"page="counter""">"counter"/a>"
      end if
     next
    end if
   end if
   'nextPage button
   if page counter - 1 then
    pagination = pagination   "a href="""targetpage"page="nextPage""">Next/a>"
   else
    pagination = pagination   "span class=""disabled"">Next/span>"
   end if
   pagination = pagination   "/div>" vbnewline
  end if
  getPaginationString = pagination
 end function
 function Ceil( dividend, divider)
  if (dividend mod divider) = 0 Then
   Ceil = dividend / divider
  ELSE
   Ceil = Int(dividend / divider) + 1
  End if
    End function
 'test script code
 page = 1
 if request("page") > "" then
  page=cint(request("page"))
 end if
 ps = getPaginationString(page, 1500, 15, 2, "pagination.asp?foo=bar")
 Response.Write("br />br />br />br />br />br />br />br />"ps)
%>



完整打包代碼:pagination(jb51.net).rar

看了有些頭暈,還是看點簡單的吧,asp與php思想差不多啊,參考了dedecms的修改方法

效果圖:

核心代碼:

復制代碼 代碼如下:

ps=cint(pageno)-2           
  if ps1 then           
  ps=1           
  end if
pe=clng(pageno)+5
if pe>mpage then pe=mpage
for i=ps to pe
if i=pageno then
lb=lb"strong>"i"/strong>"
else
lb=lb"a href=""/list/list_"theid"_"i".htm"">"i"/a>"
end if
next

完整代碼:

復制代碼 代碼如下:

pageno=cint(currentPage)
if cint(pageno)>1 then
lb=lb"a href=/list/list_"theid"_1.htm title=""首頁"">首頁/a>"
else
lb=lb"a href='#'>首頁/a>"
end if
if cint(pageno)>1 and cint(pageno) then
lb=lb"a href=/list/list_"theid"_"pageno-1".htm title=""上頁"">上頁/a>"
else
lb=lb"a href='#'>上頁/a>"
end if
ps=cint(pageno)-2           
  if ps1 then           
  ps=1           
  end if
pe=clng(pageno)+5
if pe>mpage then pe=mpage
for i=ps to pe
if i=pageno then
lb=lb"strong>"i"/strong>"
else
lb=lb"a href=""/list/list_"theid"_"i".htm"">"i"/a>"
end if
next

if cint(pageno)mpage and mpage>1 then
lb=lb"a href=/list/list_"theid"_"pageno+1".htm title=""下頁"">下頁/a>"
else
lb=lb"a href='#'>下頁/a>"
end if
if cint(pageno) mpage then
lb=lb"a href=/list/list_"theid"_"mpage".htm title=""末頁"">末頁/a>"
end if

標簽:汕頭 攀枝花 鶴崗 揭陽 唐山 撫州 海南 佛山

巨人網(wǎng)絡通訊聲明:本文標題《ASP 數(shù)字分頁效果代碼》,本文關鍵詞  ASP,數(shù)字,分頁,效果,代碼,;如發(fā)現(xiàn)本文內(nèi)容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《ASP 數(shù)字分頁效果代碼》相關的同類信息!
  • 本頁收集關于ASP 數(shù)字分頁效果代碼的相關信息資訊供網(wǎng)民參考!
  • 推薦文章
    主站蜘蛛池模板: 泰顺县| 襄城县| 新和县| 鄂托克前旗| 于都县| 吴江市| 垫江县| 陈巴尔虎旗| 洛川县| 平远县| 柳江县| 泰州市| 安吉县| 高陵县| 永新县| 鲁山县| 江阴市| 田林县| 繁昌县| 桦川县| 定南县| 武邑县| 连城县| 镇安县| 龙胜| 德保县| 分宜县| 卢龙县| 密云县| 兰坪| 池州市| 涿鹿县| 专栏| 济宁市| 酒泉市| 库尔勒市| 维西| 循化| 兴宁市| 陆良县| 神农架林区|