I
Ivo
In an Win/IE-only application, some checkboxes and the like have been
assigned accesskeys, so pressing alt+w focuses a checkbox, alt+b another.
This is very convenient. However, when the checkboxes are hidden, for
example because they are in a div styled "display:none", pressing the magic
key combination does not work of course, but instead Windows generates an
warning beep, a sound. Now I have written a function that will toggle the
elements for me when they are out of view, but the beep still occurs.
Does anyone have a bright idea how to evade the warning?
function keyd(e) {
e=e||window.event; var k=e.keyCode;
k=String.fromCharCode(k).toLowerCase();
if( k=="w" && e.altKey) { if( rip('thediv') ) {
var i=document.f.wrp; i.checked=!i.checked; wrapta(); } return false;
}
if( k=="b" && e.altKey) { if( rip('thediv') ) {
var i=document.f.bld; i.checked=!i.checked; } return false;
}
}
function rip(n){
return document.getElementById(n).className=='hid'?1:0;
}
Thanks
Ivo
assigned accesskeys, so pressing alt+w focuses a checkbox, alt+b another.
This is very convenient. However, when the checkboxes are hidden, for
example because they are in a div styled "display:none", pressing the magic
key combination does not work of course, but instead Windows generates an
warning beep, a sound. Now I have written a function that will toggle the
elements for me when they are out of view, but the beep still occurs.
Does anyone have a bright idea how to evade the warning?
function keyd(e) {
e=e||window.event; var k=e.keyCode;
k=String.fromCharCode(k).toLowerCase();
if( k=="w" && e.altKey) { if( rip('thediv') ) {
var i=document.f.wrp; i.checked=!i.checked; wrapta(); } return false;
}
if( k=="b" && e.altKey) { if( rip('thediv') ) {
var i=document.f.bld; i.checked=!i.checked; } return false;
}
}
function rip(n){
return document.getElementById(n).className=='hid'?1:0;
}
Thanks
Ivo