当前位置:编程学习 > JS >>

js实现翻页功能

#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();
}
本文出自 “一灯” 博客

补充:Web开发 , Jsp ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,