当前位置: 移动技术网 > IT编程>开发语言>Jsp > js实现翻页功能

js实现翻页功能

2018年03月19日  | 移动技术网IT编程  | 我要评论

#create ydds
#date 2008-06-20
var nextPageNo = 0;
function pageTop(){
    nextPageNo = 0
    document.getElementById("bodyDiv").innerHTML = HTMLStr[nextPageNo];
    loadData('bodyDiv');
    checkTime();
}
function pageNext(){
    if (nextPageNo < HTMLStr.length - 1)
        nextPageNo++;
    document.getElementById("bodyDiv").innerHTML = HTMLStr[nextPageNo];
    loadData('bodyDiv');
    checkTime();
}
function pageFor(){
    if (nextPageNo > 0)
        nextPageNo--;
    document.getElementById("bodyDiv").innerHTML = HTMLStr[nextPageNo];
    loadData('bodyDiv');
    checkTime();
}
function pageBottom(){
    nextPageNo = HTMLStr.length - 1;
    document.getElementById("bodyDiv").innerHTML = HTMLStr[nextPageNo];
    loadData('bodyDiv');
    checkTime();
}
function goPage(){
    var numStr = document.getElementById("InputNo").value;
    if (numStr == undefined || numStr == null) {
        return;
    }
    var num = parseInt(numStr);
    if (num > HTMLStr.length) {
        nextPageNo = HTMLStr.length - 1;
    }
    else {
        nextPageNo = num - 1;
    }
    document.getElementById("bodyDiv").innerHTML = HTMLStr[nextPageNo];
    loadData('bodyDiv');
    checkTime();
}
本文出自 “一灯” 博客

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网