js操作table之 移动TR位置.docVIP

  • 23
  • 0
  • 约6.83千字
  • 约 10页
  • 2018-01-03 发布于河南
  • 举报
js操作table之 移动TR位置

js操作table之 移动TR位置 js操作table之 移动TR位置 兼容FF 跟 IE 2010-03-17 17:34:00| 分类: 前端开发 | 标签: |字号大中小 订阅 . !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0Transitional//EN /TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=/1999/xhtml head meta http-equiv=Content-Type content=text/html;charset=utf-8 / title无标题文档/title script language=javascript var mousePos; function Up_Move(obj){ try{ if(document.all){ document.getElementById(show_input).style.top = mousePos.y document.getElementById(show_input).style.left = mousePos.x }else{ document.getElementById(show_input).style.top =mousePos.y+px; document.getElementById(show_input).style.left =mousePos.x+px; } }catch(e){} show_input_div(); document.getElementById(shuzhitijiao).onclick=function(){ varmove_no=document.getElementById(move_no).value; move_no=parseInt(move_no); if(move_no==||isNaN(move_no)){ alert(请输入要移动的位数); document.getElementById(move_no).focus(); return; } hidden_input_div(); vartable_obj,tr_obj,tr_move_obj; tr_obj=obj.parentNode.parentNode; table_obj=tr_obj.parentNode; for(vari=0;itable_obj.childNodes.length;i++){ if(tr_obj ==table_obj.childNodes[i]){ if(i==0){ alert(此记录已经是第一位); return; } if(navigator.userAgent.indexOf(MSIE)0){ if(imove_no){ tr_move_obj=table_obj.childNodes[0]; }else{ tr_move_obj=table_obj.childNodes[i-move_no]; } }else{ move_no=move_no*2; if(imove_no){ tr_move_obj=table_obj.childNodes[0]; }else{ tr_move_obj=table_obj.childNodes[i-move_no]; } } document.getElementById(move_no).value=; break; } } table_obj.removeChild(tr_obj); table_obj.insertBefore(tr_obj,tr_move_obj); document.getElementById(move_no).value=; } document.getElementById(shuzhiquxiao).onclick=function(){ hidden_input_div(); } } function Down_Move(obj){ try{ if(document.all){ document.getElementById(show_input).style.top = mousePos.y document.getElementById(show_input).st

文档评论(0)

1亿VIP精品文档

相关文档