Forum Moderators: open
This is an info site for a closed till type network, consiting of over 2500 pages designed for a 9" screen.
This script is called from each page (The parent.header.moveForward.... part is to create an array so that it could be navigated backwards (The History Nav has been system disabled on the target network)
var mykey;
if (window.Event){
document.captureEvents(Event.KEYDOWN);
}
document.onkeydown = myKeyDown;
function myKeyDown(e){
if (window.Event){
mykey = e.which;
alert(mykey);
}
else{
mykey = event.keyCode
}
mykey = String.fromCharCode(mykey);
if ((mykey == "i") ¦¦ (mykey == "I")) { parent.header.moveForward(location.href,"../index.html"); }
if ((mykey == "c") ¦¦ (mykey == "C")) { parent.header.moveForward(location.href,"../countries.html"); }
if ((mykey == "b") ¦¦ (mykey == "B")) { parent.header.moveForward(location.href,"../bfpo/bfpo.html"); }
if ((mykey == "f") ¦¦ (mykey == "F")) { parent.header.setActiveStyleSheet("large");parent.main.focus()}
}
another point to note is all my links are in the format:
<a style='cursor:hand' onclick='parent.header.moveForward(location.href,"NAME_OF_FILE.html")'>
this is so that they get added to the array and can then be rewound.
I hope some one can help on this.
I also seem to be having touble with the keypress/accesskey comand in that it wont work either (this is not the prefered option but if the hotkey solution wont work and I can this to work then I will go with it.)
Is it possible to grab the link on the page from its ID or Name.
Reason:
So that i can reference the next button (real link - which would be different on each page) with a shortcut key if they shared the same ID/NAME.
I.e. the script finds the link from the id and goes there.
In the shortcut script, have some thing like (which dont work):
if ((mykey == "x") ¦¦ (mykey == "X")) { Document.replace.getobjectID (letterX)}