div li的多行多列 無(wú)刷新分頁(yè)示例代碼
更新時(shí)間:2013年10月16日 17:23:32 作者:
翻頁(yè)文件一次加載了全部的內(nèi)容,因而不是很適合大型的網(wǎng)站,而適用于數(shù)據(jù)比較少的情況,下面有個(gè)不錯(cuò)的示例,感興趣的朋友可以參考下
翻頁(yè)文件一次加載了全部的內(nèi)容,因而不是很適合大型的網(wǎng)站,而適用于數(shù)據(jù)比較少的情況。
本例未使用數(shù)據(jù)庫(kù)。
PHP Code
<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
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; }
本例還使用了一個(gè)js jquery.pages.js 請(qǐng)到演示頁(yè)面查看源碼
本例未使用數(shù)據(jù)庫(kù)。
PHP Code
復(fù)制代碼 代碼如下:
<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
復(fù)制代碼 代碼如下:
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; }
本例還使用了一個(gè)js jquery.pages.js 請(qǐng)到演示頁(yè)面查看源碼
相關(guān)文章
詳解Laravel服務(wù)容器的優(yōu)勢(shì)
如果說(shuō)laravel框架的核心是什么,那么無(wú)疑是服務(wù)容器。理解服務(wù)容器的概念,對(duì)于我們使用laravel太重要了,應(yīng)該說(shuō)是否理解服務(wù)容器的概念是區(qū)分是否入門laravel的重要條件。因?yàn)檎麄€(gè)框架正是在服務(wù)容器這一基礎(chǔ)上構(gòu)建起來(lái)的。2021-05-05
php日期轉(zhuǎn)時(shí)間戳,指定日期轉(zhuǎn)換成時(shí)間戳
UNIX時(shí)間戳和格式化日期是我們常打交道的兩個(gè)時(shí)間表示形式,Unix時(shí)間戳存儲(chǔ)、處理方便,但是不直觀,格式化日期直觀,但是處理起來(lái)不如Unix時(shí)間戳那么自如,所以有的時(shí)候需要互相轉(zhuǎn)換,下面給出PHP日期轉(zhuǎn)時(shí)間戳、MySQL日期轉(zhuǎn)換函數(shù)互相轉(zhuǎn)換的幾種轉(zhuǎn)換方式2012-07-07
搭建Vim為自定義的PHP開(kāi)發(fā)工具的一些技巧
這篇文章主要介紹了搭建Vim為自定義的PHP開(kāi)發(fā)工具的一些技巧,Vim和Emacs被公認(rèn)為是世界上最強(qiáng)大最具人氣的代碼編輯器,需要的朋友可以參考下2015-12-12
php curl發(fā)送請(qǐng)求實(shí)例方法
在本篇文章里小編給大家整理的是關(guān)于php curl發(fā)送請(qǐng)求詳細(xì)教程以及相關(guān)知識(shí)點(diǎn),需要的朋友們可以學(xué)習(xí)下。2019-08-08
ThinkPHP6使用最新版本Endroid/QrCode生成二維碼的方法實(shí)例
這篇文章主要介紹了ThinkPHP6使用最新版本Endroid/QrCode生成二維碼的方法,結(jié)合實(shí)例形式詳細(xì)分析了ThinkPHP6使用最新版本Endroid/QrCode生成二維碼具體步驟、原理、實(shí)現(xiàn)方法與相關(guān)注意事項(xiàng),需要的朋友可以參考下2023-07-07
PHP遞歸復(fù)制、移動(dòng)目錄的自定義函數(shù)分享
這篇文章主要介紹了PHP遞歸復(fù)制、移動(dòng)目錄的自定義函數(shù)分享,本文的特點(diǎn)是對(duì)每一句代碼都做詳盡的注釋,需要的朋友可以參考下2014-11-11
php array_filter除去數(shù)組中的空字符元素
php array_filter除去數(shù)組中的空字符元素,array_filter() 函數(shù)根據(jù)回調(diào)函數(shù)過(guò)濾數(shù)組中的值,省略回調(diào)函數(shù)則默認(rèn)過(guò)濾空值,需要的朋友可以參考下。2011-11-11

