Javascript rgin:0; 溢出:可见; 填充:0.5em 1em } td:第一个孩子, 第一个孩子{ 边框左宽度:0; } 泰德{ 背景色:#E0; 颜色:#000; 文本对齐:左对齐; 垂直对齐:底部对齐; } 身份证件 名称 1. 测试1 2. 测试2 3. 测试3 4. 测试4 5. 测试5
我将提供我的解决方案Javascript rgin:0; 溢出:可见; 填充:0.5em 1em } td:第一个孩子, 第一个孩子{ 边框左宽度:0; } 泰德{ 背景色:#E0; 颜色:#000; 文本对齐:左对齐; 垂直对齐:底部对齐; } 身份证件 名称 1. 测试1 2. 测试2 3. 测试3 4. 测试4 5. 测试5,javascript,php,jquery,pagination,Javascript,Php,Jquery,Pagination,我将提供我的解决方案 var 搜索=$(“#搜索”), 控件=$(“#分页”), 表=$(“#表tbody tr”), pageParts=null, 每页=2; search.on(“keyup”,function()){ var value=$(this.val().toLowerCase(); 表.过滤器(函数(){ $(this).toggle($(this).text().toLowerCase().indexOf(value)>-1) }); updPagination(); })
var
搜索=$(“#搜索”),
控件=$(“#分页”),
表=$(“#表tbody tr”),
pageParts=null,
每页=2;
search.on(“keyup”,function()){
var value=$(this.val().toLowerCase();
表.过滤器(函数(){
$(this).toggle($(this).text().toLowerCase().indexOf(value)>-1)
});
updPagination();
});
控件。分页({
每页,
cssStyle:“灯光主题”,
onPageClick:函数(pageNum){
var start=每页*(pageNum-1);
var end=开始+每页;
如果(第页){
pageParts.hide()
.slice(开始、结束).show();
}
}
});
函数updPagination(){
pageParts=table.filter(函数(){return$(this.css(“display”)!=='none'});
pageParts.slice(perPage.hide();
控件。分页('selectPage',1);
控件.pagination('updateItems',pageParts.length);
}
updPagination()代码>
表格{
边界塌陷:塌陷;
边界间距:0;
空单元格:显示;
边框:1px实心#cbcbcb;
}
运输署,
th{
左边框:1px实心#cbcbcb;
边框宽度:0 1px;
字体大小:继承;
保证金:0;
溢出:可见;
填充:0.5em 1em
}
td:第一个孩子,
第一个孩子{
边框左宽度:0;
}
泰德{
背景色:#E0;
颜色:#000;
文本对齐:左对齐;
垂直对齐:底部对齐;
}
身份证件
名称
1.
测试1
2.
测试2
3.
测试3
4.
测试4
5.
测试5
请添加您正在使用的html。您应该使用您的服务器端语言对服务器端进行分页。因此,检索所有项目的子集,并在用户滚动时加载更多项目。Jquery是客户端,我认为simplePagination这个名字说明了一切。它只对一组完整的数据执行简单的客户端分页。规范没有表明它可以按需执行任何形式的服务器请求。@SamuelJMathew html5?我想他是指从页面中添加HTML示例(不仅仅是图像):)请添加您正在处理的HTML。您应该使用服务器端语言对服务器端进行分页。因此,检索所有项目的子集,并在用户滚动时加载更多项目。Jquery是客户端,我认为simplePagination这个名字说明了一切。它只对一组完整的数据执行简单的客户端分页。规范并没有表明它可以按需执行任何形式的服务器请求。@SamuelJMathew html5?我认为他的意思是从页面中添加HTML示例(不仅仅是图像):)这是一个很好的实践,因此可以解释解决方案。你为什么不通过添加一个解释来改进答案呢?这是一个很好的实践,所以解释解决方案。你为什么不增加一个解释来改进答案呢?
$("#pagination").pagination({
items: numItems,
itemsOnPage: perPage,
cssStyle: "light-theme",
// This is the actual page changing functionality.
onPageClick: function(pageNumber) {
// We need to show and hide `tr`s appropriately.
var showFrom = perPage * (pageNumber - 1);
var showTo = showFrom + perPage;
// We'll first hide everything...
items.hide()
// ... and then only show the appropriate rows.
.slice(showFrom, showTo).show();
}
});
<html lang="pt-br">
<head>
<link rel="stylesheet" href="assets/css/simplePagination.css">
<script src="assets/js/jquery.simplePagination.js"></script>
<script type="text/javascript">
$(function(){
var keywordInput = document.querySelector("input[name='keyword']");
function performMark() {
$(".content.panel").show();
// Read the keyword
var keyword = keywordInput.value;
$('.content').removeClass('hidden');
$('.content:not(:contains(' + keyword + '))').addClass('hidden');
/* Tentar refazer paginação */
var items = $(".content.panel").not(".hidden");
var numItems = items.length;
var perPage = 16;
// Only show the first 2 (or first `per_page`) items initially.
items.slice(perPage).hide();
$("#pagination").pagination({
items: numItems,
itemsOnPage: perPage,
cssStyle: "light-theme",
// This is the actual page changing functionality.
onPageClick: function(pageNumber) {
// We need to show and hide `tr`s appropriately.
var showFrom = perPage * (pageNumber - 1);
var showTo = showFrom + perPage;
// We'll first hide everything...
items.hide()
// ... and then only show the appropriate rows.
.slice(showFrom, showTo).show();
}
});
};
// Listen to input and option changes
keywordInput.addEventListener("input", performMark);
});
</script>
<script type="text/javascript">
$(function() {
var items = $(".content.panel").not(".hidden");
var numItems = items.length;
var perPage = 16;
// Only show the first 2 (or first `per_page`) items initially.
items.show();
items.slice(perPage).hide();
// Now setup the pagination using the `.pagination-page` div.
$("#pagination").pagination({
items: numItems,
itemsOnPage: perPage,
cssStyle: "light-theme",
// This is the actual page changing functionality.
onPageClick: function(pageNumber) {
// We need to show and hide `tr`s appropriately.
var showFrom = perPage * (pageNumber - 1);
var showTo = showFrom + perPage;
// We'll first hide everything...
items.hide()
// ... and then only show the appropriate rows.
.slice(showFrom, showTo).show();
}
});
function checkFragment() {
// If there's no hash, treat it like page 1.
var hash = window.location.hash || "#page-1";
// We'll use a regular expression to check the hash string.
hash = hash.match(/^#page-(\d+)$/);
if(hash) {
// The `selectPage` function is described in the documentation.
// We've captured the page number in a regex group: `(\d+)`.
$("#pagination").pagination("selectPage", parseInt(hash[1]));
}
};
// We'll call this function whenever back/forward is pressed...
$(window).bind("popstate", checkFragment);
// ... and we'll also call it when the page has loaded
// (which is right now).
checkFragment();
});
</script>
<!--link href="assets/css/table.css" rel="stylesheet"-->
</head>
<body onload="myFunction()">
<div class="container">
<div id="loader"></div>
<div style="display:none;" id="myDiv" class="animate-bottom">
<div class="input-group input-group-lg" style="margin-bottom: 15px;">
<span class="input-group-addon glyphicon glyphicon-search" id="sizing-addon1" style="position: initial;"></span>
<input name="keyword" type="text" class="form-control" placeholder="Pesquisar" aria-describedby="sizing-addon1" onload="performMark()">
</div>
<div id="pagination" style="margin-bottom: 5px;"></div>
<div class='row centered'>
<?php
$sql = "SELECT * FROM USU_TDriCad";
$stid = oci_parse($conn, $sql);
oci_execute($stid);
while (($row = oci_fetch_array($stid, OCI_BOTH)) != false) {
$CodDri = 'test';
$CodDri = (isset($row['USU_CODDRI']) ? $row['USU_CODDRI'] : '');
echo '<div class="content warning">
<div class="content panel panel-warning">
<div class="panel-heading highlight">
<h3 class="panel-title">' . $StrLoc . '</h3>
</div>
<div class="panel-body warning highlight" style="padding: 2px">
' . $CodDri . '
</div>
<div class="panel-body warning highlight" style="padding: 2px; font-size: 16px">
<div class="col-xs-6">1000</div>
<div class="col-xs-6">#008</div>
</div>
</div>
</div>';
}
oci_free_statement($stid);
?>
</div>
</div>
</div>
</body>
</html>