我正在尝试让这个分页插件在我的网站上正确激活:http://listjs.com/examples/paging.html 。 它处于事件状态,但功能不正常,仅显示 3 个列表结果,并且没有用于转到下一页的导航。您可以在这里看到它:http://bluebeam.com/us/support/articles/list.asp
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script type="text/javascript">
/*
* LOVELY THINGS
*/
var options = {
valueNames: [ 'name', 'description', 'category' ],
page: 3,
plugins: [ [ 'paging' , {
innerWindow: 1,
left: 2,
right: 3} ] ]
};
var featureList = new List('support-articles', options);
$('#filter-install').click(function() {
featureList.filter(function(item) {
if (item.values().category == "Common Solutions") {
return true;
} else {
return false;
}
});
return false;
});
$('#filter-revu').click(function() {
featureList.filter(function(item) {
if (item.values().category == "Revu") {
return true;
} else {
return false;
}
});
return false;
});
$('#filter-plugins').click(function() {
featureList.filter(function(item) {
if (item.values().category == "Plug-ins") {
return true;
} else {
return false;
}
});
return false;
});
$('#filter-printer').click(function() {
featureList.filter(function(item) {
if (item.values().category == "PDF Printer") {
return true;
} else {
return false;
}
});
return false;
});
$('#filter-admin').click(function() {
featureList.filter(function(item) {
if (item.values().category == "Administrator") {
return true;
} else {
return false;
}
});
return false;
});
$('#filter-3rd-party').click(function() {
featureList.filter(function(item) {
if (item.values().category == "3rd Party") {
return true;
} else {
return false;
}
});
return false;
});
$('#filter-video').click(function() {
featureList.filter(function(item) {
if (item.values().name == "Video") {
return true;
} else {
return false;
}
});
return false;
});
$('#filter-article').click(function() {
featureList.filter(function(item) {
if (item.values().name == "Article") {
return true;
} else {
return false;
}
});
return false;
});
$('#filter-none').click(function() {
featureList.filter();
return false;
});
</script>
我做错了什么?
最佳答案
我缺少一个<ul class="paging"></ul>
在我的容器 div 中。
关于javascript - 使用 javascript 分页 <li> 不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12099175/