Div Li's multiple-row, multiple-column, no-refresh paging sample code _php Tips

Source: Internet
Author: User
The paging file loads all the content at once, so it is not very suitable for large web sites, but it is suitable for less data.
The database is not used in this example.

PHP Code
Copy Code code as follows:

<div class= "Container" >
<ul id= "Content" >
<?php for ($i =1; $i <=53; $i + +) {?>
<li><span><?php Echo $i?></span></li>
<?php}?>
</ul>
<div class= "Holder" ></div>
</div>

JavaScript Code
<script type= "Text/javascript" >
$ (document). Ready (function () {
$ ("Div.holder"). Jpages ({
Containerid: "Content",
Perpage:6
});
});
</script>
[/code]
CSS Code
Copy Code code as follows:

Body {
Text-align:left;
direction:ltr;
Font-family:tahoma,verdana,arial,sans-serif;
font-size:11px;
}
. container {
width:370px;
height:100%;
margin:0 Auto;
}
/*
@@ Demo
*/
UL {
margin:0;
padding:20px 0px;
}
UL Li {
List-style-type:none;
Display:inline-block;
line-height:100px;
Text-align:center;
Font-weight:bold;
width:100px;
height:100px;
margin:10px;
Background: #ccc;
}
UL Li Span {
Color: #fff;
padding:3px;
}
/*
@@ pagination
*/
. holder {margin:5px 0;}
. Holder a {
font-size:12px;
Cursor:pointer;
Margin:0 5px;
Color: #333;
}
. Holder A:hover {
Background-color: #222;
Color: #fff;
}
. Holder a.jp-previous {margin-right:15px;}
. Holder A.jp-next {margin-left:15px;}
. Holder A.jp-current, A.jp-current:hover {
Color: #ed4e2a;
Font-weight:bold;
}
. Holder a.jp-disabled, a.jp-disabled:hover {color: #bbb;}
. Holder A.jp-current, A.jp-current:hover,
. Holder a.jp-disabled, A.jp-disabled:hover {
Cursor:default;
Background:none;
}
. Holder span {margin:0 5px;}

This example also uses a JS jquery.pages.js please go to the demo page to view the source code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.