admin管理员组文章数量:1022679
I have a client that is required to be ADA-pliant. We found an issue when using IE9 and the JAWS screen reader. We have a jQuery function set up to scroll to another element on the page when the user Tabs down to a button and hits Enter. Here is the function:
jQuery('#ball_i5nqtjcVVB0CxYBJICklS6w').keypress(function(event) {
if (event.keyCode == 13) {
jQuery("#headofcurve").focus();
scrollTo("form");
liveballTag('Learn More');
}
});
The problem is that when JAWS is running, hitting Enter doesn't do anything. I must hit Shift + Enter in order for it to scroll to the proper section and begin reading.
I have a client that is required to be ADA-pliant. We found an issue when using IE9 and the JAWS screen reader. We have a jQuery function set up to scroll to another element on the page when the user Tabs down to a button and hits Enter. Here is the function:
jQuery('#ball_i5nqtjcVVB0CxYBJICklS6w').keypress(function(event) {
if (event.keyCode == 13) {
jQuery("#headofcurve").focus();
scrollTo("form");
liveballTag('Learn More');
}
});
The problem is that when JAWS is running, hitting Enter doesn't do anything. I must hit Shift + Enter in order for it to scroll to the proper section and begin reading.
Share Improve this question edited Jun 20, 2018 at 21:06 SOLO 8789 silver badges19 bronze badges asked Oct 29, 2014 at 19:30 notAGoodDevelopernotAGoodDeveloper 672 silver badges8 bronze badges 2- What element is it that you tab to and press enter? Is it a link or form control? If not, it might not work as expected without quite a bit of extra markup/script. – AlastairC Commented Oct 30, 2014 at 22:08
- AlastairC it is a link. the button, when clicked on or when ENTER is hit should scroll the page down to the video section or form - depending on which button you select. jQuery is used for the scrollTo function. – notAGoodDeveloper Commented Nov 3, 2014 at 15:47
1 Answer
Reset to default 6This is normal behavior. It happens because of the way how JAWS (and most other moder screen readers, btw) handles webpages and other HTML-like content.
When a user opens up a webpage, he/she observes it with a so-called virtual cursor. That means that all keyboard mands change their meanings on webpages. This is done for the sake of quick navigation. For example, if you press h, you move to the next heading; if you press b, you move to the next button, and so on.
In order to type in something, you should be in forms mode. To enter the forms mode, you should press Enter on a form element such as an edit field or a bo box.
This said, you can't expect that Enter would be processed as you're used to do it without JAWS running.
You have two solutions here:
- Change the keystroke to scroll to your element from Enter to, say, Ctrl+Enter (I'd suggest choosing another one since Ctrl+Enter is used for sending messages in tons of messengers and other software alike).
- Assigning the
application
ARIA role to a part of your page. If JAWS encounters theapplication
role, it passes all the keyboard mands through to the webpage itself. But be extremely careful with this mode since it's suggested by W3 Consortium not to overuse this role.
I have a client that is required to be ADA-pliant. We found an issue when using IE9 and the JAWS screen reader. We have a jQuery function set up to scroll to another element on the page when the user Tabs down to a button and hits Enter. Here is the function:
jQuery('#ball_i5nqtjcVVB0CxYBJICklS6w').keypress(function(event) {
if (event.keyCode == 13) {
jQuery("#headofcurve").focus();
scrollTo("form");
liveballTag('Learn More');
}
});
The problem is that when JAWS is running, hitting Enter doesn't do anything. I must hit Shift + Enter in order for it to scroll to the proper section and begin reading.
I have a client that is required to be ADA-pliant. We found an issue when using IE9 and the JAWS screen reader. We have a jQuery function set up to scroll to another element on the page when the user Tabs down to a button and hits Enter. Here is the function:
jQuery('#ball_i5nqtjcVVB0CxYBJICklS6w').keypress(function(event) {
if (event.keyCode == 13) {
jQuery("#headofcurve").focus();
scrollTo("form");
liveballTag('Learn More');
}
});
The problem is that when JAWS is running, hitting Enter doesn't do anything. I must hit Shift + Enter in order for it to scroll to the proper section and begin reading.
Share Improve this question edited Jun 20, 2018 at 21:06 SOLO 8789 silver badges19 bronze badges asked Oct 29, 2014 at 19:30 notAGoodDevelopernotAGoodDeveloper 672 silver badges8 bronze badges 2- What element is it that you tab to and press enter? Is it a link or form control? If not, it might not work as expected without quite a bit of extra markup/script. – AlastairC Commented Oct 30, 2014 at 22:08
- AlastairC it is a link. the button, when clicked on or when ENTER is hit should scroll the page down to the video section or form - depending on which button you select. jQuery is used for the scrollTo function. – notAGoodDeveloper Commented Nov 3, 2014 at 15:47
1 Answer
Reset to default 6This is normal behavior. It happens because of the way how JAWS (and most other moder screen readers, btw) handles webpages and other HTML-like content.
When a user opens up a webpage, he/she observes it with a so-called virtual cursor. That means that all keyboard mands change their meanings on webpages. This is done for the sake of quick navigation. For example, if you press h, you move to the next heading; if you press b, you move to the next button, and so on.
In order to type in something, you should be in forms mode. To enter the forms mode, you should press Enter on a form element such as an edit field or a bo box.
This said, you can't expect that Enter would be processed as you're used to do it without JAWS running.
You have two solutions here:
- Change the keystroke to scroll to your element from Enter to, say, Ctrl+Enter (I'd suggest choosing another one since Ctrl+Enter is used for sending messages in tons of messengers and other software alike).
- Assigning the
application
ARIA role to a part of your page. If JAWS encounters theapplication
role, it passes all the keyboard mands through to the webpage itself. But be extremely careful with this mode since it's suggested by W3 Consortium not to overuse this role.
本文标签: jqueryJavaScript keypress function and JAWSStack Overflow
版权声明:本文标题:jquery - JavaScript keypress function and JAWS - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745573802a2156896.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论