200 分悬赏

platinum 2002-07-03 07:57:16
像了解问题的请看如下这个连接

http://www.arkbook.com/icon/

问题为

http://www.arkbook.com/temp/wenti.gif

请问如果想实现这个功能那么 http://www.arkbook.com/icon/list.html 这页应该如何改

问题只给第一个完美解决的人
...全文
36 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
lanbor 2002-07-03
  • 打赏
  • 举报
回复
哦.随便检查了一下.有些错误(可能还有,可是网吧的条件实在太差,连我的电脑都不能用:(.

if( currP > indexArray.length) alert('对不起已经是最后一页了. ');
if( currP <0 ) alert('对不起已经是最前一页了. ');

后加上 return; 退出.

lanbor 2002-07-03
  • 打赏
  • 举报
回复
indexArray = new Array();

indexAaray[0]="aa";
indexArray[indexArray.length] = "ab";
indexArray[indexArray.length] = "ab";
indexArray[indexArray.length] = "ac";
indexArray[indexArray.length] = "ad";
:
:
indexArray[indexArray.length] = "za";
indexArray[indexArray.length] = "zb";
indexArray[indexArray.length] = "zc";

currP = 0;
currIndex = "aa";

goNext()
{
currP ++;

if( currP > indexArray.length) alert('对不起已经是最后一页了. ');

currIndex = indexArray[currP];


for(var i=0;i< listnow.options.length;i++){

if (listnow.options[i].value == currIndex ) {
listnow.options[i].selected=true
break;
}
}
}

goPre()
{
currP --;

if( currP <0 ) alert('对不起已经是最前一页了. ');

currIndex = indexArray[currP];

for(var i=0;i< listnow.options.length;i++){

if (listnow.options[i].value == currIndex ) {
listnow.options[i].selected=true
break;
}
}
}

<button onclick="goNext()">下一页</button>
<button onclick="goPre()">前一页</button>

我在网吧.不能调试代码.但大概意思就是这样...
skyover 2002-07-03
  • 打赏
  • 举报
回复
应该是这个。

<script>
<!--
function addOption() {
for(var i=000;i<100;i++) {
var sName = "馒头" + i;
var sValue = i;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
document.form1.select1.options.add(oOption);
}
}

function prev() {
document.form1.select1.selectedIndex = document.form1.select1.selectedIndex - 1;
}

function next() {
document.form1.select1.selectedIndex = parseInt(document.form1.select1.selectedIndex) + 1;
}
//-->
</script>

<body onload="addOption()">
<form id="form1" name="form1" onsubmit="form_submit(this);">
<select id="select1" name="select1"></select>
<button onclick="prev()">上一页</button>
<button onclick="next()">下一页</button>
</form>
</body>
skyover 2002-07-03
  • 打赏
  • 举报
回复
<script>
<!--
function addOption() {
for(var i=0;i<100;i++) {
var sName = "馒头" + i;
var sValue = i;
var oOption = document.createElement('OPTION');
oOption.text = sName;
oOption.value = sValue;
document.form1.select1.options.add(oOption);
}
}

function prev() {
document.form1.select1.selectedIndex = document.form1.select1.value - 1;
}

function next() {
document.form1.select1.selectedIndex = parseInt(document.form1.select1.value) + 1;
}
//-->
</script>

<body onload="addOption()">
<form id="form1" name="form1" onsubmit="form_submit(this);">
<select id="select1" name="select1"></select>
<button onclick="prev()">上一页</button>
<button onclick="next()">下一页</button>
</form>
</body>

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧