谁能提供一个js分页效果,在没有分页的时候不显示 简单来说就是既要有一个分页效果,可以点击图片分页的那种,同时要在不超过1页的时候不显示出来分页 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的意思是不是用ajax请求在服务器端把html打出来? var pageIndex;var totalCount;var totalSize;var pageSize = 6;function init() {$.ajax({ url: url, data: { cmd: "getAllCount", userid: "" }, cache: false, async: false, success: function (data) { pageIndex = 1; totalCount = parseInt(data); totalSize = totalCount % pageSize == 0 ? parseInt(totalCount / pageSize) : parseInt(totalCount / pageSize + 1); } });if (pageIndex > 1) { $("#prePage")[0].style.display = "inline"; } if (pageIndex < totalSize) { $("#nextPage")[0].style.display = "inline"; $("#selectpagerange")[0].style.display = "inline"; for (var i = 0; i < totalSize; i++) { $("#selectpage")[0].options.add(new Option((i+1),i)); } }}function nextPage() { pageIndex += 1; if (currli != '') { getNoteByType(currentType, currli); } else { getNoteByType(currentType); } select();}function prePage() { pageIndex -= 1; if (currli != '') { getNoteByType(currentType, currli); } else { getNoteByType(currentType); } select();}function selectPage(page) { for (var i = 0; i < page.options.length; i++) { if(page.options[i].selected){ pageIndex = parseInt(page.options[i].text); } } if (currli != '') { getNoteByType(currentType, currli); } else { getNoteByType(currentType); } select();}function select() { for (var i = 0; i < $("#selectpage1")[0].options.length; i++) { if ($("#selectpage1")[0].options[i].text == (pageIndex + '')) $("#selectpage1")[0].options[i].selected = true; }} 怎么发?邮件?谢谢啦,不过我不需要下拉框,只要上一页、下一页,其他都不需要[email protected] 好吧 selectpagerange selectpage select();这些你自己去掉 发了,是在default页面里面 notepadIndex.js 这个文件里的 java 请教JS计算公式 js获取下拉框的值在FF下不正常? 如何可以打开一个网页就跳到别一网页 模态对话框提交struts2请求 请问如何在网页中加入报警声? 怎样才能另存用插件打开的文件? 已知文件路径,要从路径中解析文件名,求正则表达式 在javscript中怎样判断一个字符串中的回车符,并把它删除? jquery mobile 字段值相加的问题。 求帮忙修改一段分页的js 如何在一个JS文件中包含另一个JS文件呢?
var totalCount;
var totalSize;
var pageSize = 6;
function init() {
$.ajax({
url: url,
data: { cmd: "getAllCount", userid: "" },
cache: false,
async: false,
success: function (data) {
pageIndex = 1;
totalCount = parseInt(data);
totalSize = totalCount % pageSize == 0 ? parseInt(totalCount / pageSize) : parseInt(totalCount / pageSize + 1);
}
});
if (pageIndex > 1) {
$("#prePage")[0].style.display = "inline";
}
if (pageIndex < totalSize) {
$("#nextPage")[0].style.display = "inline";
$("#selectpagerange")[0].style.display = "inline";
for (var i = 0; i < totalSize; i++) {
$("#selectpage")[0].options.add(new Option((i+1),i));
}
}
}
function nextPage() {
pageIndex += 1;
if (currli != '') {
getNoteByType(currentType, currli);
} else {
getNoteByType(currentType);
}
select();
}
function prePage() {
pageIndex -= 1;
if (currli != '') {
getNoteByType(currentType, currli);
} else {
getNoteByType(currentType);
}
select();
}
function selectPage(page) {
for (var i = 0; i < page.options.length; i++) {
if(page.options[i].selected){
pageIndex = parseInt(page.options[i].text);
}
}
if (currli != '') {
getNoteByType(currentType, currli);
} else {
getNoteByType(currentType);
}
select();
}
function select() {
for (var i = 0; i < $("#selectpage1")[0].options.length; i++) {
if ($("#selectpage1")[0].options[i].text == (pageIndex + ''))
$("#selectpage1")[0].options[i].selected = true;
}
}
[email protected]