设为首页
加入收藏
联系站长
您现在的位置: 网贝 >> 建站学院 >> 网页设计 >> JavaScript >> 文章正文 用户登录 新用户注册
js分页         ★★★★
js分页
相关网站:
作者:佚名 文章来源:网贝整理 点击数: 更新时间:2005-4-14
<html>
<head>
<title>流星花园</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="I's,漫画下载,cg">
<meta name="description" content="在线经典漫画欣赏及下载">
</head>

<body bgcolor=#eeeeee link=#0066FF vlink="#0066FF">
<script language=javascript>
//*****************************
//
//     本程序由木鸟原始制作
// 只要保留本版权信息可免费使用
//   未经许可不得用于商业用途!
//
//   http://www.9seek.com/
//
//*****************************
var chapter,page;
var maxCh=4;
var maxP=new Array();
for(i=1;i<=4;i++)
maxP[i]=10;
maxP[1]=79;
maxP[2]=85;
maxP[3]=92;
maxP[4]=93;


function comein(){
var the_cookie=getcookie();
if (the_cookie=="" || isNaN(the_cookie)){
show(1,0);}
else{
var arr=the_cookie.split(":")
var c=parseInt(arr[0]);
var p=parseInt(arr[1]);
var blShow=window.confirm("您上次看到 "+c+" 章 "+p+" 页,要继续看吗?")
if (blShow)
show(c,p);
else
show(1,0);
}
}

function show(ch,p)
{
setcookie(ch,p)
var chapter1=ch,page1=p;
if (chapter1>maxCh || chapter1<1)
chapter1=1;
chapter=parseInt(chapter1);
if (page1>maxP[chapter1] || page1<0)
page1=0;
page=parseInt(page1);

showlink();
chapter1="00"+chapter1;
chapter1=chapter1.slice(chapter1.length-2);
page1="00"+page1;
page1=page1.slice(page1.length-3);
cartoon.innerHTML="<img src="+chapter1+"-"+page1+".jpg>";
}

function showlink()
{
guide.innerHTML="";
guide.innerHTML=guide.innerHTML+"共 <font color=red><b>"+maxCh+"</b></font> 章 第 <font color=red><b>"+chapter+"</b></font> 章 ";
if (chapter-1>0)
guide.innerHTML=guide.innerHTML+" <a href=# onclick=javascript:show("+(chapter-1)+",0)>上一章</a>";
else
guide.innerHTML=guide.innerHTML+" <font color=gray>上一章</font>";

if (chapter+1<=maxCh)
guide.innerHTML=guide.innerHTML+" <a href=# onclick=javascript:show("+(chapter+1)+",0)>下一章</a> ";
else
guide.innerHTML=guide.innerHTML+" <font color=gray>下一章</font> ";

guide.innerHTML=guide.innerHTML+"本章共 <font color=red><b>"+maxP[chapter]+"</b></font> 页 第 <font color=red></b>"+page+"</b></font> 页";
if (page-1>=0)
guide.innerHTML=guide.innerHTML+" <a href=# onclick=javascript:show("+chapter+","+(page-1)+")>上一页</a>";
else{
if (chapter-1>0)
guide.innerHTML=guide.innerHTML+" <a href=# onclick=javascript:show("+(chapter-1)+","+(maxP[chapter-1])+")>上一页</a>";
else
guide.innerHTML=guide.innerHTML+" <font color=gray>上一页</font>";
}

if (page+1<=maxP[chapter])
guide.innerHTML=guide.innerHTML+" <a href=# onclick=javascript:show("+chapter+","+(page+1)+")>下一页</a>";
else{
if (chapter+1<=maxCh)
guide.innerHTML=guide.innerHTML+" <a href=# onclick=javascript:show("+(chapter+1)+",0)>下一页</a>";
else
guide.innerHTML=guide.innerHTML+" <font color=gray>下一页</font>";
}


//输入
guide.innerHTML=guide.innerHTML+" 跳至<input type=text name=textCh size=3 style='border:1 solid red' >章<input type=text name=textP size=3 style='border:1 solid red' >页 <input type=button value=GO style=height:20 onclick=show(textCh.value,textP.value) >";

}

function setcookie(c,p){
//if (c==maxCh&&p==maxP[c])
//return;

if (c==1&&p==1){
document.cookie="";
return;
}

var the_cookie=c+":"+p;
var the_date=new Date("December 31, 2023");
the_date=the_date.toGMTString();
the_cookie=the_cookie+";expires="+the_date;
document.cookie=the_cookie;
}

function getcookie(){
var the_cookie=document.cookie;
return the_cookie;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="150" align="center"><a href="http://9seek.com/" target="_top"><img src="../../images/bbslogo.gif" width="100" height="60" border="0" alt="9seek.com"></a></td>
<td align="center"><font color="#FF6633">本页内容采用 <b>DHTML </b>技术制作,图片没有及时出现的话请耐心等待!!</font></td>
<td align="center" width="150"></td>
</tr>
</table>
<table border=0 width=100% style=font-size:20pt>
<tr>
<td align=center><b><font color="#6666CC">流 星 花 园</font></b></td>
</tr>
</table>

<table border=1 width=100%  style=font-size:10pt >
<tr height=30 bgcolor=#99cccc align=center><td id=guide></td></tr>
<tr height=30 align=center><td id="cartoon"></td></tr>
</table>

<script>
comein();
</script>

</body>
</html>
文章录入:admin    责任编辑:admin 
  • 上一篇文章:

  • 下一篇文章:
  • 【字体: 】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口
    相关网站:

    文章 下载 图片
    普通文章[组图]随机显示广告
    普通文章随机广告代码全集
    普通文章实现在新窗口中打开
    普通文章延迟/定时/强制弹出
    推荐文章对联广告代码大全
    普通文章用js绘图
    普通文章JScript 客户端 Req
    普通文章只能限制输入中文的
    推荐文章对联广告代码大全
    推荐文章可设置同一IP弹出窗
    推荐文章[组图]JavaScript教
    推荐文章Slide show 的制作
    推荐文章制作自动关闭的窗口
    推荐文章透明渐变弹出菜单的
    推荐文章玩转花样表单
    普通文章把手教你写私服列表
    普通文章WEB标准
    普通文章GOOGLE sitemap官方
    普通文章用php定制404错误页
    普通文章WAP(wml)开发问答
    普通文章[组图]PS教程系列:快
    普通文章时使用apache和IIS,
    普通文章[组图]2005年的第一
    推荐文章[组图]彻底掌握IIS6
    推荐文章[组图]CSS 全攻略
    推荐文章各种脚本错误详解!
    推荐文章直接生成XML的Googl
    推荐文章九个常见的错误原因
    推荐文章Win XP家用版也能装
    推荐文章JSP入门初级教程之J
    推荐文章ASP入门及提高
  • 海量数据高性能分

  • 只能限制输入中文


  • 让网页适应不同的浏

    JavaScript教程

    下拉菜单全攻略 Jav
    (只显示最新10条。评论内容只代表网友观点,与本站立场无关!)

    Copyright © 2003-2005 NetBei.com All rights reserved.