|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jun 2000
Città: Ostia beach [Roma]
Messaggi: 1292
|
Explorer: disabiltare i vari F1, F3 ecc..
Saluti a tutti
sto facendo un progetto html con un pochino di javascript. Ho fatto una cosina semplice x catturare la pressione dei tasti da F1 a F10 e tutto ok. Il problema è che per quei tasti default di explorer (F1, F3 ecc) prima esegue il default e poi la mia funzione... tipo x F1 apre l'help è possibile disabilitare le funzioni di default?? ovviamente deve essere fatto con del codice javascript non nelle impostazioni di explorer.. Grazie in anticipo Saluti
__________________
Sometimes it snows in April Sometimes I feel so bad, so bad Sometimes I wish life was never ending And all good things, they say, never last |
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Come fai a catturare i tasti funzione ?
|
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Jun 2000
Città: Ostia beach [Roma]
Messaggi: 1292
|
onkeydown....
ora non ce l'ho domani posto lo script
__________________
Sometimes it snows in April Sometimes I feel so bad, so bad Sometimes I wish life was never ending And all good things, they say, never last |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Ok...prova in fondo all'azione a mettere return false;
Ad esempio : onkeydown=".....; return false;" Per evitare che si possano selezionare i contenuti con il mouse si fa in questo modo... |
|
|
|
|
|
#5 |
|
Senior Member
Iscritto dal: Jun 2000
Città: Ostia beach [Roma]
Messaggi: 1292
|
ecco lo script:
<HTML> <HEAD> <TITLE></TITLE> <META http-equiv="Content-Type" content="text/html"> <META content="NetExpress 3.1" name="GENERATOR"> <SCRIPT LANGUAGE=JavaScript> function body1_onkeydown_func() { getKey(); } function getKey(keyStroke) { var keyCode = (document.layers) ? keyStroke.which : event.keyCode; if (keyCode == 13) { window.document.form1.submit3.click(); } if (keyCode == 112) { window.document.form1.submit1.click(); } if (keyCode == 118) { window.document.form1.submit2.click(); } } </SCRIPT> </HEAD>
__________________
Sometimes it snows in April Sometimes I feel so bad, so bad Sometimes I wish life was never ending And all good things, they say, never last |
|
|
|
|
|
#6 |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Hai provato con il return false ?
|
|
|
|
|
|
#7 |
|
Senior Member
Iscritto dal: Jun 2000
Città: Ostia beach [Roma]
Messaggi: 1292
|
si
e non sembra funzionare.. ma forse l'ho messo ne posto sbagliato dove deve andare esattamente??
__________________
Sometimes it snows in April Sometimes I feel so bad, so bad Sometimes I wish life was never ending And all good things, they say, never last |
|
|
|
|
|
#8 |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Codice:
<html>
<head>
<title>Untitled</title>
<script>
<!--
function miaFunzione()
{
var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
if(keyCode == 112) //scrive 'ciao' se premo la 'p'
alert('ciao');
}
//-->
</script>
</head>
<body onkeypress="miaFunzione(); return false;">
<input type="text">
</body>
</html>
|
|
|
|
|
|
#9 |
|
Senior Member
Iscritto dal: Apr 2001
Città: Lyon
Messaggi: 112
|
<html>
<head> <title>Untitled</title> <script> <!-- function miaFunzione() { alert('ciao'); } //--> </script> </head> <body onhelp="miaFunzione(); return false;"> <input type="text"> </body> </html> l'evento onhelp sembra disabilitare l'aiuto di IE.
__________________
Be Glopil !!! Grand Fainéant !FANCAZZISTA MAXIMUS - Gran Modificatore della Sacra Santa Quinta Regola - Moderatore Voci Nel Web |
|
|
|
|
|
#10 |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Tutti questi eventi strani...mah...
|
|
|
|
|
|
#11 |
|
Senior Member
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
|
Ora c'è da trovare gli altri eventi per F3, F4, F6, F10, F11
Che OO... Mai che a casa MS facciano le cose semplici... |
|
|
|
|
|
#12 |
|
Senior Member
Iscritto dal: Apr 2001
Città: Lyon
Messaggi: 112
|
Comunque <body onhelp="miaFunzione(); return true;"> mostra il messaggio e dopo l'aiuto. Quindi mettere return false; sembra essere una buona idea.
__________________
Be Glopil !!! Grand Fainéant !FANCAZZISTA MAXIMUS - Gran Modificatore della Sacra Santa Quinta Regola - Moderatore Voci Nel Web |
|
|
|
|
|
#13 |
|
Senior Member
Iscritto dal: Jun 2000
Città: Ostia beach [Roma]
Messaggi: 1292
|
grazie a tutti
ma credo che alla fine dirò che non si può fare tanto decido io
__________________
Sometimes it snows in April Sometimes I feel so bad, so bad Sometimes I wish life was never ending And all good things, they say, never last |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 05:25.



















