Ver Mensaje Individual
  #3 (permalink)  
Antiguo 26/05/2009, 08:30
Avatar de colote
colote
 
Fecha de Ingreso: julio-2008
Ubicación: Rosario - Santa Fe - Argentina
Mensajes: 729
Antigüedad: 16 años, 7 meses
Puntos: 8
Respuesta: Sube y baja por los a href ...

Gracias a zerokilled sigo adelante con este script ...
Ahora lo que hice fue tener un solo archivo.js el que incluyo en cada pagina

Código javascript:
Ver original
  1. cont=1;
  2. function subeybaja(){
  3.  
  4. document.onkeydown =function(e){
  5. if(window.event){tecla = e.keyCode;}else if(e.which){tecla = e.which;}
  6. var donde = document.getElementById('navi');
  7. max = donde.getElementsByTagName('a').length;
  8. //alert("max: "+max);
  9.  
  10. if(cont<1) {cont=1;}
  11. if(cont>max) {cont=max;}
  12.  
  13. if(tecla==40){
  14.     cont++;
  15.     document.getElementById('b'+cont).focus();
  16.     //alert("a_"+cont);
  17.     }  //   abajo
  18.  
  19. if(tecla==38){
  20.     cont--;
  21.     document.getElementById('b'+cont).focus();
  22.     //alert("a_"+cont);
  23.     }  //   abajo
  24.  
  25. if(tecla == 27){self.location.href='inicio.php';}
  26.  
  27. if(tecla == 48||tecla== 96){ window.close();}         //0
  28. if(tecla == 49||tecla== 97){ b1=document.getElementById('b1');self.location.href=b1;}         //1
  29. if(tecla == 50||tecla== 98){ b2=document.getElementById('b2');self.location.href=b2;}         //2
  30. if(tecla == 51||tecla== 99){ b3=document.getElementById('b3');self.location.href=b3;}         //3
  31. if(tecla == 52||tecla==100){ b4=document.getElementById('b4');self.location.href=b4;}         //4
  32. if(tecla == 53||tecla==101){ b5=document.getElementById('b5');self.location.href=b5;}         //5
  33. if(tecla == 54||tecla==102){ b6=document.getElementById('b6');self.location.href=b6;}         //6
  34. if(tecla == 55||tecla==103){ b7=document.getElementById('b7');self.location.href=b7;}         //7
  35. if(tecla == 56||tecla==104){ b8=document.getElementById('b8');self.location.href=b8;}         //8
  36. if(tecla == 57||tecla==105){ b9=document.getElementById('b9');self.location.href=b9;}         //9
  37.  
  38. }
  39. }

Lo que no tengo listo es el tema de la tecla ESC, para cuando por ejemplo, este dentro de la pagina ventas / pedidos y presupuestos / y aprete ESC me abra ventas y no inicio, como lo tengo. Como hago para guardar el valor de la pagina anterior en una variable ?

Saludos, Ricardo !!!
__________________
Mail: [email protected]

Última edición por colote; 26/05/2009 a las 13:54