I wanted to use the paging program I found on the Internet, but I had to modify it. It was troublesome. I had to write it myself. It would be convenient to modify it later ~~ Everyone has a lot of hands-on work. What they write is the best. What they want to do in the future is easy to modify ~~ Expand your own code library ~~
In addition, cpage is the page count and should be a global variable so that it can be called everywhere. totalpage is the total number of pages.
<! Doctype html public "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ptml xmlns = "http://www.w3.org/1999/xhtml" lang = "gb2312"> <pead> <title> JS static paging Program </title> </pead> <style type = "text/css">: link, a: visited, a: hover ,. current, # info {border: 1px solid # DDD; background: # F2F2F2; display: inline-block; margin: 1px; text-decoration: none; font-size: 12px; width: 15px; height: 15px; text-align: center; line-height: 15px; color: # AAA; padding: 1px 2px;} a: hover {border: 1px solid # E5E5E5; background: # F9F9F9 ;}. current {border: 1px solid #83E7E4; background: # DFF9F8; margin: 1px; color: #27CBC7; }# info {width: auto ;} </style> <body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]