Commit 20b9258d by Diana Huang

Add in tabIndex to ensure that the tabbing works properly for link.

LMS-1311
parent d34c4a66
...@@ -110,11 +110,14 @@ var accessible_modal = function(trigger, closeButtonId, modalId, mainPageId) { ...@@ -110,11 +110,14 @@ var accessible_modal = function(trigger, closeButtonId, modalId, mainPageId) {
}); });
}; };
// NOTE: This is a gross hack to make the skip links work for Webkit browsers
// see http://stackoverflow.com/questions/6280399/skip-links-not-working-in-chrome/12720183#12720183
// handle things properly for clicks // handle things properly for clicks
jQuery('#skip-link a').click(function() { jQuery('#skip-link a').click(function() {
var href = jQuery(this).attr('href'); var href = jQuery(this).attr('href');
if(href) { if(href) {
jQuery(href).focus(); jQuery(href).attr('tabIndex', -1).focus();
} }
}); });
// and for the enter key // and for the enter key
...@@ -122,7 +125,7 @@ jQuery('#skip-link a').keypress(function(e) { ...@@ -122,7 +125,7 @@ jQuery('#skip-link a').keypress(function(e) {
if(e.which == 13) { if(e.which == 13) {
var href = jQuery(this).attr('href'); var href = jQuery(this).attr('href');
if(href) { if(href) {
jQuery(href).focus(); jQuery(href).attr('tabIndex', -1).focus();
} }
} }
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment