Disable F1 effect (help) from browser using javascript
Posted in browser help, customize help, disable F1, disable help, javascript 2 comments
This is a simple way to disable the default help in browser if you want to create your own help :)
Most of the code I "borrowed" from Dan Bartels' Blog and just make couple of modifications on it.
enjoy it
Most of the code I "borrowed" from Dan Bartels' Blog and just make couple of modifications on it.
enjoy it
document.onhelp = new Function("return false;");
window.onhelp = new Function("return false;");
document.onkeydown = function (evt) {
if (evt == null) evt = event; if (testKeyCode(evt, 112)) //F1
{
cancelKeyEvent(evt); //don't allow default help popup by F1
alert(navigator.appName); alert("This is the new help");
return false;
}
}
function cancelKeyEvent(evt) {
if (window.createPopup) evt.keyCode = 0;
else evt.preventDefault();
}
function testKeyCode(evt, intKeyCode) {
if (window.createPopup) return evt.keyCode == intKeyCode;
else return evt.which == intKeyCode;
}
2 comments:
Thank you
- Krish
Thanks and that i have a neat supply: How Much Is House Renovation Loan In Pag Ibig whole home remodel cost
Post a Comment