请帮我改一下这段代码,请帮忙! 修改一下selectRow()函数,让返回一个object试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <table onkeyup="ChangePage(this)" width="70%" border="1"> <tr> <th>col1</th> <th>col2</th> <th>col3</th> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr></table><script >var currowno=0;var oldrowno=0;var oldColor="#eeeeee";var newColor="#ff0000";function ChangePage(table) { var KeyCode = event.keyCode; var len = table.rows.length; if (KeyCode == 38) { if(currowno>1) { if(oldrowno<len-1) { table.rows(oldrowno+1).style.backgroundColor=""; } table.rows(oldrowno).style.backgroundColor=oldColor; currowno--; if(currowno>0) { table.rows(currowno).style.backgroundColor=newColor; } oldrowno=currowno; } } if (KeyCode == 40 ) { if(currowno <len-1) { if(oldrowno>0) { if(oldrowno>1) { table.rows(oldrowno-1).style.backgroundColor=""; } table.rows(oldrowno).style.backgroundColor=oldColor; } currowno++; table.rows(currowno).style.backgroundColor=newColor; oldrowno=currowno; } } } </script> <table onkeyup="ChangePage(this)" width="70%" border="1"> <tr> <th>col1</th> <th>col2</th> <th>col3</th> </tr> <tr> <td>1</td> <td>2</td> <td>3</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr> <tr> <td>11</td> <td>22</td> <td>33</td> </tr></table><script >var currowno=0;var oldrowno=0;var oldColor="#eeeeee";var newColor="#ff0000";function ChangePage(table) { var KeyCode = event.keyCode; var len = table.rows.length; if (KeyCode == 38) { if(currowno>1) { if(oldrowno<len-1) { table.rows(oldrowno+1).style.backgroundColor=""; } table.rows(oldrowno).style.backgroundColor=oldColor; currowno--; if(currowno>0) { table.rows(currowno).style.backgroundColor=newColor; } oldrowno=currowno; } } if (KeyCode == 40 ) { if(currowno <len-1) { if(oldrowno>0) { if(oldrowno>1) { table.rows(oldrowno-1).style.backgroundColor=""; } table.rows(oldrowno).style.backgroundColor=oldColor; } currowno++; table.rows(currowno).style.backgroundColor=newColor; oldrowno=currowno; } } } </script> function ChangePage(KeyCode,url) { if (KeyCode == 38) { if(currowno>1) { if(table!=null && currowno>1 && oldrowno!=null) { table.rows(oldrowno).style.backgroundColor=oldColor; } currowno--; if(table!=null && currowno>0) { oldColor=table.rows(currowno).style.backgroundColor; table.rows(currowno).style.backgroundColor=newColor; } oldrowno=currowno; } } if (KeyCode == 40 ) { if(currowno <table.rows.length-1) { if(table!=null && currowno <table.rows.length && oldrowno!=null && oldrowno <table.rows.length-1) { table.rows(oldrowno).style.backgroundColor=oldColor;; } currowno++; if(table!=null && currowno <table.rows.length) { oldColor=table.rows(currowno).style.backgroundColor; table.rows(currowno).style.backgroundColor=newColor; } oldrowno=currowno; } } if (KeyCode == 13) { //打回车处理 //event.returnValue = false; window.opener.location.href=../contractlr.aspx?id1=( )&id2=( ); } } 比如括号的地方,要传两上参数过去,参数是表格当前的第一个单元格,和第二个单元格的值,应该怎么写呢/谢谢~ 这个不行啊,怎样得到currowno行单元格的值啊? 表格currowno行单元格的第一个单元格: table.rows(oldrowno).cell[0].innerHTML和第二个单元格的值:table.rows(oldrowno).cell[1].innerHTML jquery editInPlace怎么用 这段JS在Firefox下无效,IE6、IE8都正常,帮我看看啊。 二维数组树形结构,怎么取得一个类别下的所有子类。 问个正则表达式 谁那里有IBM HTTP SERVER 6.0高分求 散分过国庆~~~~~~~~~~~~ 怎么实现重复提交不提示? 有关聊天室的问题,请高手指教! 能不能说说正则表达式的规则 急!!!!!!!!!如何判断一个窗口是否处于当前所有窗口的最前面???? 急!使用AJAX数据列表不能更新 关于文本框输入问题----如何利用正则表达式禁止输入&这个特殊字符
<table onkeyup="ChangePage(this)" width="70%" border="1">
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
</table>
<script >
var currowno=0;
var oldrowno=0;
var oldColor="#eeeeee";
var newColor="#ff0000";
function ChangePage(table)
{
var KeyCode = event.keyCode;
var len = table.rows.length;
if (KeyCode == 38)
{
if(currowno>1)
{
if(oldrowno<len-1)
{
table.rows(oldrowno+1).style.backgroundColor="";
}
table.rows(oldrowno).style.backgroundColor=oldColor;
currowno--;
if(currowno>0)
{
table.rows(currowno).style.backgroundColor=newColor;
}
oldrowno=currowno;
}
}
if (KeyCode == 40 )
{
if(currowno <len-1)
{
if(oldrowno>0)
{
if(oldrowno>1)
{
table.rows(oldrowno-1).style.backgroundColor="";
}
table.rows(oldrowno).style.backgroundColor=oldColor;
}
currowno++;
table.rows(currowno).style.backgroundColor=newColor;
oldrowno=currowno;
}
}
} </script>
<tr>
<th>col1</th>
<th>col2</th>
<th>col3</th>
</tr>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
<tr>
<td>11</td>
<td>22</td>
<td>33</td>
</tr>
</table>
<script >
var currowno=0;
var oldrowno=0;
var oldColor="#eeeeee";
var newColor="#ff0000";
function ChangePage(table)
{
var KeyCode = event.keyCode;
var len = table.rows.length;
if (KeyCode == 38)
{
if(currowno>1)
{
if(oldrowno<len-1)
{
table.rows(oldrowno+1).style.backgroundColor="";
}
table.rows(oldrowno).style.backgroundColor=oldColor;
currowno--;
if(currowno>0)
{
table.rows(currowno).style.backgroundColor=newColor;
}
oldrowno=currowno;
}
}
if (KeyCode == 40 )
{
if(currowno <len-1)
{
if(oldrowno>0)
{
if(oldrowno>1)
{
table.rows(oldrowno-1).style.backgroundColor="";
}
table.rows(oldrowno).style.backgroundColor=oldColor;
}
currowno++;
table.rows(currowno).style.backgroundColor=newColor;
oldrowno=currowno;
}
}
} </script>
{ if (KeyCode == 38)
{
if(currowno>1)
{ if(table!=null && currowno>1 && oldrowno!=null)
{
table.rows(oldrowno).style.backgroundColor=oldColor;
}
currowno--;
if(table!=null && currowno>0)
{
oldColor=table.rows(currowno).style.backgroundColor;
table.rows(currowno).style.backgroundColor=newColor;
}
oldrowno=currowno;
}
}
if (KeyCode == 40 )
{
if(currowno <table.rows.length-1)
{
if(table!=null && currowno <table.rows.length && oldrowno!=null && oldrowno <table.rows.length-1)
{
table.rows(oldrowno).style.backgroundColor=oldColor;;
}
currowno++;
if(table!=null && currowno <table.rows.length)
{
oldColor=table.rows(currowno).style.backgroundColor;
table.rows(currowno).style.backgroundColor=newColor;
}
oldrowno=currowno;
}
}
if (KeyCode == 13)
{
//打回车处理
//event.returnValue = false;
window.opener.location.href=../contractlr.aspx?id1=( )&id2=( );
}
} 比如括号的地方,要传两上参数过去,参数是表格当前的第一个单元格,和第二个单元格的值,应该怎么写呢/谢谢~
这个不行啊,怎样得到currowno行单元格的值啊?