웹 프론트엔드 JS 튜토리얼 effect_javascript 기술을 전환하는 js 페이징 코드

effect_javascript 기술을 전환하는 js 페이징 코드

May 16, 2016 pm 06:52 PM
js

로딩하는데 시간이 좀 걸리니 잠시만 기다려주세요.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

<!--

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**

* 用js分页显示ul/ol的列表

*

* 这里的演示设置了自动滚动

*

* PHP versions 4 and 5

*

* LICENSE: This source file is subject to version 3.0 of the PHP license

* that is available through the world-wide-web at the following URI:

* <a rel="nofollow" href="http://www.php.net/license/3_0.txt." target="_blank">http://www.php.net/license/3_0.txt.</a> If you did not receive a copy of

* the PHP License and are unable to obtain it through the web, please

* send a note to license@php.net so we can mail you a copy immediately.

*

* @package GCCMS

* @author Yi Bo <etng2004@gmail.com>

* @copyright 2000-2005 GCSOFT.COM & ETNG.NET

* @license <a rel="nofollow" href="http://www.php.net/license/3_0.txt" target="_blank">http://www.php.net/license/3_0.txt</a> PHP License 3.0

* @version SVN: $Id: page.html 21 2006-01-22 09:35:58Z etng $

* @link $HeadURL: svn://dev.gccms.net/trunk/page.html $

* @see

* @since

*/

--><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>无标题文档</title>

<style type="text/css">

<!--

/*这里填写自己需要的css定义*/

body { width: 760px; padding: 0 0 0 0; margin: 0 auto 0 auto; font-size: 12px; font-family: "Arial", "Helvetica", "sans-serif"; }

td { font-size: 12px; }

ul,li,form,p,span { padding: 0 0 0 0; margin: 0 0 0 0; }

.ctrlPages {COLOR: #f60;cursor:hand;}

.curPage {COLOR: #f00;cursor:hand;}

-->

</style>

<script language="JavaScript">

<!--

var ETNGpager = function( srcName, dstName, cntPP, cntPS )

{

this.srcName= srcName;

this.dstName= dstName;

this.curP= 1;//默认当前页为第一页

this.cntPP= cntPP || 2;//默认每页两条纪录

this.cntPS= cntPS || 3;//默认每页显示5个分页上下文

this.items= [];

this.showPNP= true;/*显示上下页链接*/

this.showType= true;/*滑动分页*/

this.result= {pagedata:[],pagebar:&#39;&#39;,limit:[0,0],report:&#39;&#39;};

this.parse();/*总纪录数*/

}

ETNGpager.prototype.page = function (){

this.cntP= Math.ceil(this.cntR/this.cntPP);/*总页数*/

this.cntS= Math.ceil(this.cntP/this.cntPS);/*总段数*/

this.curS= Math.ceil(this.curP/this.cntPS);/*当前段*/

this.preP= this.curP -1;/*上一页*/

this.nextP= this.curP +1;/*下一页*/

this.preS= this.curS -1;/*上一段*/

this.nextS= this.curS +1;/*下一段*/

this.startR= (this.curP -1)*this.cntPP + 1;/*起始纪录*/

this.endR= (this.curP*this.cntPP >this.cntR)?this.cntR:this.curP*this.cntPP;/*结束纪录*/

this.result[&#39;pagedata&#39;]=[];

if(this.showType){

this.perSide= Math.floor(this.cntPS/2);

this.startP= (this.curP > this.perSide)?(this.curP - this.perSide):1;

this.endP= (this.startP + this.cntPS)>this.cntP?this.cntP:(this.startP + this.cntPS);

}else{

this.startP= (this.curS-1)*this.cntPS+1;

this.endP= (this.curS*this.cntPS>this.cntP)?this.cntP:(this.curS*this.cntPS);

}

for(var i = this.startP;i<=this.endP;i++){

this.result[&#39;pagedata&#39;].push((i==this.curP)?&#39;<span class="curPage">&#39;+i+&#39;</span>&#39;:&#39;<span onclick="page(&#39;+i+&#39;)">&#39;+i+&#39;</span>&#39;);

}

if(this.showPNP){

if(this.curP>1)this.result[&#39;pagedata&#39;].unshift(&#39;<span onclick="page(&#39;+(this.curP-1)+&#39;)">上一页</span>&#39;);

if(this.curP<this.cntP)this.result[&#39;pagedata&#39;].push(&#39;<span onclick="page(&#39;+(this.curP+1)+&#39;)">下一页</span>&#39;);

}

this.result[&#39;pagebar&#39;]= this.result[&#39;pagedata&#39;].join(&#39; &#39;);

this.result[&#39;limit&#39;]= [this.startR,this.endR];

this.result[&#39;report&#39;]= &#39;共&#39;+this.cntR+&#39;条,当前页&#39;+this.startR+&#39;-&#39;+this.endR+&#39;,&#39;+this.curP+&#39;/&#39;+this.cntP+&#39;页&#39;;

}

ETNGpager.prototype.parse = function (){

var obj = document.getElementById(this.srcName);

for(var i = 0;i<obj.childNodes.length;i++){

if(obj.childNodes[i].nodeType!=3)this.items[this.items.length]=obj.childNodes[i].innerHTML;

}

this.cntR = this.items.length;

return this.items.length;

}

ETNGpager.prototype.create=function(){

this.page();

document.getElementById(this.dstName).innerHTML=&#39;<li>&#39;+this.items.slice(this.startR-1,this.endR).join(&#39;</li><li>&#39;)+&#39;</li>&#39;;

document.getElementById(this.dstName).innerHTML+=&#39;<span class="ctrlPages">&#39;+this.result[&#39;pagebar&#39;]+this.result[&#39;report&#39;]+&#39;</span>&#39;;

}

//-->

</script>

</head>

<body>

<ul id="listcontent" style="display:none;">

<li><a href=<a rel="nofollow" href="http://tech.sina.com.cn/i/2005-12-08/1204786367.shtml" target="_blank">http://tech.sina.com.cn/i/2005-12-08/1204786367.shtml</a> target=&#39;_blank&#39;>支付宝与六大代理签订协议 </a></li>

<li><a href=<a rel="nofollow" href="http://forum.taobao.com/showThread.htm?thread=3123988&forum=14" target="_blank">http://forum.taobao.com/showThread.htm?thread=3123988&forum=14</a> target=&#39;_blank&#39;>刷卡积分可网上购物 </a></li>

<li><a href=/alipay/news/sample/23492.htm target=&#39;_blank&#39;>支付宝为网店保驾护航 </a></li>

<li><a href=<a rel="nofollow" href="http://it.people.com.cn/GB/8219/50656/52310/3822563.html" target="_blank">http://it.people.com.cn/GB/8219/50656/52310/3822563.html</a> target=&#39;_blank&#39;>支付宝红包送来红地毯 </a></li>

<li><a href=/alipay/news/sample/22701.htm target=&#39;_blank&#39;>紧急天气预报"红色风暴"空降支付宝 </a></li>

<li><a href=/alipay/news/sample/22699.htm target=&#39;_blank&#39;>小红包背后大名堂 </a></li>

<li><a href=<a rel="nofollow" href="http://www.q88.net/SHOP_2005A/zfb.aspx" target="_blank">http://www.q88.net/SHOP_2005A/zfb.aspx</a> target=&#39;_blank&#39;>Q88.net全面无缝接合支付宝 </a></li>

<li><a href=/alipay/news/sample/21529.htm target=&#39;_blank&#39;>电子支付规范走出第一步 使用专业版受鼓励 </a></li>

<li><a href=/alipay/news/sample/19786.htm target=&#39;_blank&#39;>从支付宝看电子商务的发展 </a></li>

<li><a href=/alipay/news/sample/19784.htm target=&#39;_blank&#39;>谁能与支付宝PK? </a></li>

<li><a href=/alipay/news/sample/19618.htm target=&#39;_blank&#39;>国内第一家引入支付宝的网络图库正式开通 </a></li>

<li><a href=/alipay/news/sample/19475.htm target=&#39;_blank&#39;>新浪网:中关村在线加入支付宝联盟 </a></li>

<li><a href=/alipay/news/sample/19471.htm target=&#39;_blank&#39;>千家网店加入支付宝联盟 </a></li>

<li><a href=/alipay/news/sample/18549.htm target=&#39;_blank&#39;>我与支付宝的分分秒秒 </a></li>

<li><a href=/alipay/news/sample/18207.htm target=&#39;_blank&#39;>支付宝—放心"网宝"的理由 </a></li>

<li><a href=/alipay/news/sample/17944.htm target=&#39;_blank&#39;>欧飞数卡携手支付宝,再创新高 </a></li>

<li><a href=/alipay/news/sample/17803.htm target=&#39;_blank&#39;>莎莎香水网:支付宝助我完成销售计划 </a></li>

<li><a href=/alipay/news/sample/17801.htm target=&#39;_blank&#39;>使用支付宝:一个月交易额翻5倍 </a></li>

<li><a href=/alipay/news/sample/17799.htm target=&#39;_blank&#39;>支付宝:一个普通站长的自述 </a></li>

<li><a href=/alipay/news/sample/17797.htm target=&#39;_blank&#39;>新开网店如何日交易额达8000元? </a></li>

<li><a href=/alipay/news/sample/17563.htm target=&#39;_blank&#39;>名大数码:网店月交易额如何突破30万 </a></li>

<li><a href=<a rel="nofollow" href="http://it.sohu.com/20050916/n240400443.shtml" target="_blank">http://it.sohu.com/20050916/n240400443.shtml</a> target=&#39;_blank&#39;>中国卡网结盟支付宝创交易量周增长新高 </a></li>

<li><a href=<a rel="nofollow" href="http://it.people.com.cn/GB/42891/42894/3676101.html" target="_blank">http://it.people.com.cn/GB/42891/42894/3676101.html</a> target=&#39;_blank&#39;>支付宝联盟与合作伙伴合作在人民网推广 </a></li>

<li><a href=<a rel="nofollow" href="http://forum.taobao.com/show_thread-50---103546-.htm" target="_blank">http://forum.taobao.com/show_thread-50---103546-.htm</a> target=&#39;_blank&#39;>网络银行使用全攻略---足不出户查看汇款明细 </a></li>

<li><a href=<a rel="nofollow" href="http://forum.taobao.com/show_thread-50---1561087-.htm" target="_blank">http://forum.taobao.com/show_thread-50---1561087-.htm</a> target=&#39;_blank&#39;>"支付宝购物体验"征文-----贿赂 </a></li>

<li><a href=<a rel="nofollow" href="http://forum.taobao.com/show_thread-50---2102458-.htm" target="_blank">http://forum.taobao.com/show_thread-50---2102458-.htm</a> target=&#39;_blank&#39;>卖家谈:谁是支付宝最终的获利者? </a></li>

<li><a href=<a rel="nofollow" href="http://forum.taobao.com/show_thread-50---1617047-.htm" target="_blank">http://forum.taobao.com/show_thread-50---1617047-.htm</a> target=&#39;_blank&#39;>淘宝两钻卖家感悟支付宝 </a></li>

<li><a href=<a rel="nofollow" href="http://forum.taobao.com/show_thread-50---1686484-.htm" target="_blank">http://forum.taobao.com/show_thread-50---1686484-.htm</a> target=&#39;_blank&#39;>支付宝"即时到帐交易"的使用经验及建议 </a></li>

<li><a href=<a rel="nofollow" href="http://forum.taobao.com/show_thread-50---1794216-.htm" target="_blank">http://forum.taobao.com/show_thread-50---1794216-.htm</a> target=&#39;_blank&#39;>我的第一笔网上交易 </a></li>

</ul>

<ul id="listcontent2">列表信息加载中,请您稍等……</ul>

<script language="JavaScript">

<!--

var pager = new ETNGpager(&#39;listcontent&#39;,&#39;listcontent2&#39;,10,5);

var curP = 1;

showtime = setInterval("page()", 5000);

function page(i){

curP =(curP>pager.cntP)?1:curP;

if(i){

curP = n =i;

}else{

n = curP++;

}

pager.curP = (n>pager.cntP)?pager.cntP:n;

pager.create();

}

//-->

</script>

</body>

</html>

로그인 후 복사
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

권장 사항: 우수한 JS 오픈 소스 얼굴 감지 및 인식 프로젝트 권장 사항: 우수한 JS 오픈 소스 얼굴 감지 및 인식 프로젝트 Apr 03, 2024 am 11:55 AM

얼굴 검출 및 인식 기술은 이미 상대적으로 성숙하고 널리 사용되는 기술입니다. 현재 가장 널리 사용되는 인터넷 응용 언어는 JS입니다. 웹 프런트엔드에서 얼굴 감지 및 인식을 구현하는 것은 백엔드 얼굴 인식에 비해 장점과 단점이 있습니다. 장점에는 네트워크 상호 작용 및 실시간 인식이 줄어 사용자 대기 시간이 크게 단축되고 사용자 경험이 향상된다는 단점이 있습니다. 모델 크기에 따라 제한되고 정확도도 제한됩니다. js를 사용하여 웹에서 얼굴 인식을 구현하는 방법은 무엇입니까? 웹에서 얼굴 인식을 구현하려면 JavaScript, HTML, CSS, WebRTC 등 관련 프로그래밍 언어 및 기술에 익숙해야 합니다. 동시에 관련 컴퓨터 비전 및 인공지능 기술도 마스터해야 합니다. 웹 측면의 디자인으로 인해 주목할 가치가 있습니다.

JS 및 Baidu Maps를 사용하여 지도 이동 기능을 구현하는 방법 JS 및 Baidu Maps를 사용하여 지도 이동 기능을 구현하는 방법 Nov 21, 2023 am 10:00 AM

JS 및 Baidu Map을 사용하여 지도 팬 기능을 구현하는 방법 Baidu Map은 지리 정보, 위치 지정 및 기타 기능을 표시하기 위해 웹 개발에 자주 사용되는 널리 사용되는 지도 서비스 플랫폼입니다. 이 글에서는 JS와 Baidu Map API를 사용하여 지도 이동 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 1. 준비 바이두 맵 API를 사용하기 전에 먼저 바이두 맵 오픈 플랫폼(http://lbsyun.baidu.com/)에서 개발자 계정을 신청하고 애플리케이션을 만들어야 합니다. 생성 완료

주식 분석을 위한 필수 도구: PHP 및 JS를 사용하여 캔들 차트를 그리는 단계를 알아보세요. 주식 분석을 위한 필수 도구: PHP 및 JS를 사용하여 캔들 차트를 그리는 단계를 알아보세요. Dec 17, 2023 pm 06:55 PM

주식 분석을 위한 필수 도구: PHP 및 JS에서 캔들 차트를 그리는 단계를 배우십시오. 인터넷과 기술의 급속한 발전으로 주식 거래는 많은 투자자에게 중요한 방법 중 하나가 되었습니다. 주식분석은 투자자의 의사결정에 있어 중요한 부분이며 캔들차트는 기술적 분석에 널리 사용됩니다. PHP와 JS를 사용하여 캔들 차트를 그리는 방법을 배우면 투자자가 더 나은 결정을 내리는 데 도움이 되는 보다 직관적인 정보를 얻을 수 있습니다. 캔들스틱 차트는 주가를 캔들스틱 형태로 표시하는 기술 차트입니다. 주가를 보여주네요

PHP와 JS를 사용하여 주식 촛대 차트를 만드는 방법 PHP와 JS를 사용하여 주식 촛대 차트를 만드는 방법 Dec 17, 2023 am 08:08 AM

PHP와 JS를 사용하여 주식 캔들 차트를 만드는 방법 주식 캔들 차트는 주식 시장에서 흔히 사용되는 기술 분석 그래픽으로 시가, 종가, 최고가 등의 데이터를 그려서 투자자가 주식을 보다 직관적으로 이해할 수 있도록 도와줍니다. 주식의 최저 가격. 이 기사에서는 특정 코드 예제와 함께 PHP 및 JS를 사용하여 주식 캔들 차트를 만드는 방법을 설명합니다. 1. 준비 시작하기 전에 다음 환경을 준비해야 합니다. 1. PHP를 실행하는 서버 2. HTML5 및 Canvas를 지원하는 브라우저 3

JS와 Baidu Map을 활용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 JS와 Baidu Map을 활용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 Nov 21, 2023 am 11:11 AM

JS 및 Baidu Maps를 사용하여 지도 클릭 이벤트 처리 기능을 구현하는 방법 개요: 웹 개발에서는 지리적 위치 및 지리적 정보를 표시하기 위해 지도 기능을 사용해야 하는 경우가 많습니다. 지도에서의 클릭 이벤트 처리는 지도 기능에서 일반적으로 사용되는 중요한 부분입니다. 이 글에서는 JS와 Baidu Map API를 사용하여 지도의 클릭 이벤트 처리 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 단계: Baidu Map API 파일 가져오기 먼저 다음 코드를 통해 Baidu Map API 파일을 가져올 수 있습니다.

JS 및 Baidu Maps를 사용하여 지도 히트맵 기능을 구현하는 방법 JS 및 Baidu Maps를 사용하여 지도 히트맵 기능을 구현하는 방법 Nov 21, 2023 am 09:33 AM

JS 및 Baidu Maps를 사용하여 지도 열 지도 기능을 구현하는 방법 소개: 인터넷과 모바일 장치의 급속한 발전으로 지도는 일반적인 응용 시나리오가 되었습니다. 시각적 표시 방법인 히트맵은 데이터 분포를 보다 직관적으로 이해하는 데 도움이 될 수 있습니다. 이 기사에서는 JS 및 Baidu Map API를 사용하여 지도 히트맵 기능을 구현하는 방법을 소개하고 구체적인 코드 예제를 제공합니다. 준비 작업: 시작하기 전에 Baidu 개발자 계정, 애플리케이션 생성, 해당 AP 획득 등의 항목을 준비해야 합니다.

PHP 및 JS 개발 팁: 주식 캔들 차트 그리기 방법 익히기 PHP 및 JS 개발 팁: 주식 캔들 차트 그리기 방법 익히기 Dec 18, 2023 pm 03:39 PM

인터넷 금융의 급속한 발전으로 인해 주식 투자는 점점 더 많은 사람들의 선택이 되었습니다. 주식 거래에서 캔들 차트는 주가의 변화 추세를 보여주고 투자자가 보다 정확한 결정을 내리는 데 도움이 되는 일반적으로 사용되는 기술적 분석 방법입니다. 이 기사에서는 PHP와 JS의 개발 기술을 소개하고 독자가 주식 캔들 차트를 그리는 방법을 이해하도록 유도하며 구체적인 코드 예제를 제공합니다. 1. 주식 캔들 차트의 이해 주식 캔들 차트를 그리는 방법을 소개하기 전에 먼저 캔들 차트가 무엇인지부터 이해해야 합니다. 캔들스틱 차트는 일본인이 개발했습니다.

js와 vue의 관계 js와 vue의 관계 Mar 11, 2024 pm 05:21 PM

js와 vue의 관계: 1. 웹 개발의 초석인 JS 2. 프론트엔드 프레임워크로서의 Vue.js의 등장 3. JS와 Vue의 상호 보완적인 관계 4. JS와 Vue의 실제 적용 Vue.

See all articles