Page 1 of 1

Accessible Keyboard menu trigger no longer working in IE

Posted: Thu Dec 20, 2007 3:18 am
by JAB Creations
Navigate to this link in IE6 or IE7...
http://www.jabcreations.com/blog/

Press the tab key to navigate with the keyboard, and then press the spacebar key to activate the menus. It would be easiest to give the login form input elements focus and then tab from there. When you activate the menus (Fiction~Web) in Firefox or Opera 9.5+ the submenus will appear and thus the menus are completely keyboard accessible. However I'm hitting some unknown error 'keyCode' is null or not an object. Thing is this works in Version 2.8 Preview II when this code was directly in the XHTML inside of an onkeypress attribute though I have modularized it since, this is now Version 2.8 Preview IV. Any way, any suggestions as to what is causing the menu scripts to break in IE? You can find the functions here...

Look for the line containing, function init28() which is called by the window.onload function in another file (these functions are required to be loaded via window.onload and thus are called via their parent function being called in the window.onload function).

Posted: Thu Dec 20, 2007 12:03 pm
by John Cartwright
Asking people to dig through your source code instead of posting the relevant code usually leads to people skipping your thread ;)

Posted: Fri Dec 21, 2007 3:55 am
by JAB Creations
Here is an example. Again it works if played in an onkeypress attribute but that would be messy! :wink:

Code: Select all

function init28() {
document.getElementById("menua1k").onkeypress = function(e) { if (e.keyCode == 9) return true; else change('menub1', 'menuba'); change('menub1', 'list'); }
}