小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

asp.net如果在頁面上用js實現(xiàn)分頁?

 悟靜 2012-11-18
< html>  
    
< body>  
    
< span id=contents>
  
    
< span id=splitpage>  
    
< script type="text/javascript">  
    
_currentPage = 2;//設(shè)置當(dāng)前頁碼  
_indexContainer = document.all.splitpage;//設(shè)置存放分頁索引號的容器  
_contentContainer = document.all.contents;//設(shè)置存放分頁內(nèi)容的容器  
_totalPages = 0;//初始化總頁數(shù)  
(function pageLoad() {  
    _indexContainer.innerHTML =pageNo(100,2,10,7).join(" ");  
    var str="getR("+3+")";  
goToPage(100, 3, 10,7,str);  
})();  
    
//返回頁碼對象  
function pageNo(counts, currentPage, perPage,showIndex,str) {  
    var perPage = perPage ? perPage : 5;
  
    
    
    var pages=0;  
    pages=counts/perPage+1;  
    var pageIndex = [];  
    //插入第一頁標(biāo)識   
    if(currentPage==1){  
        pageIndex.push("《《 《 ");  
    }else{//注意這里是 A標(biāo)簽 我把前面的<去掉了 因為 加上后會讓系統(tǒng)會自動識別成連接無法正常顯示代碼  
        var str1="a href=\"javascript:goToPage("+counts+", "+1+", "+perPage+","+showIndex+",'"+str+"')\">《《 a href=\"javascript:goToPage("+counts+", "+(currentPage-1>0?currentPage-1:1)+", "+perPage+","+showIndex+",'"+str+"')\">《 ";  
        pageIndex.push(str1);  
    }  
    
    var cyclCousnts=parseInt(showIndex/2);  
        
for(var i=1;i<=showIndex;i++){  
        var tmpPage=currentPage>=cyclCousnts?currentPage-cyclCousnts+i-1:i;  
        if(currentPage==tmpPage)  
            pageIndex.push("font color=\"red\">"+tmpPage+"");  
        else if(tmpPage>pages)  
            continue;  
        else if(tmpPage<1)  
            continue;  
        else{//注意這里是 A標(biāo)簽 我把前面的<去掉了 因為 加上后會讓系統(tǒng)會自動識別成連接無法正常顯示代碼  
            var str1="a href=\"javascript:goToPage("+counts+", "+tmpPage+", "+perPage+","+showIndex+",'"+str+"')\">"+tmpPage+"";  
            pageIndex.push(str1);  
        }  
    }  
    if(currentPage==pages){  
        pageIndex.push(" 》 》》");  
    }else{//注意這里是 A標(biāo)簽 我把前面的<去掉了 因為 加上后會讓系統(tǒng)會自動識別成連接無法正常顯示代碼  
        var str1="a href=\"javascript:goToPage("+counts+", "+(currentPage+1>pages?currentPage:currentPage+1)+", "+perPage+","+showIndex+",'"+str+"')\">》  a href=\"javascript:goToPage("+counts+", "+pages+", "+perPage+","+showIndex+",'"+str+"')\">》》 ";  
        pageIndex.push(str1);  
    }  
        
    return pageIndex;  
}  
    
    
function goToPage(counts, currentPage, perPage,showIndex,str) {  
    _contentContainer.innerHTML = eval(str);  
    _indexContainer.innerHTML = pageNo(counts, currentPage, perPage,showIndex,str).join(" ");  
}  
    
function getRecord(currentPage){  
    return "the current pagaea  is:"+currentPage;  
}  
    
function getR(currentPage){  
    return "the current page  by eval is:"+currentPage;  
}  
    
< /script>  
< /body>  
< /html> 

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多