Is ARIA compatible with jQuery events?
Hello,
I would like to know if ARIA is compatible with jQuery events? This is above my level of skill and I don't have time to look through documentation.
I am trying to get this sub menu accessible. I have tried this code with ARIA, but it is not working. Any pointers?
- <script type="text/javascript">
jQuery(document).ready(function($) {
$('.bbp-admin-links:even').css({position: 'absolute', right: '380px'});
$('.bbp-meta ul.bbp_custom_links_menu li.parent > a').click(function(e) {
var options = $(this).closest('.bbp_custom_links_submenu');
if (options.attr('aria-expanded') == 'true') options.attr('aria-expanded', 'false');
else options.attr('aria-expanded', 'true');
$(this).next('.bbp_custom_links_submenu').toggle();
e.preventDefault();
})
.on('mouseup touchend', function(e) {
e.stopPropagation();
});
$(document).on('mouseup touchend', function(e) {
if (!$(e.target).closest('.bbp_custom_links_submenu').length) {
$('.bbp_custom_links_submenu').hide();
$('.bbp_custom_links_submenu').attr('aria-expanded', 'false');
}
});
});
</script>
This code works fine to open and close the menu, but NVDA is not picking up that there is any ARIA there. It does not say when the menu is opened or closed. So my question, is my code wrong, or can you even use ARIA with jQuery events?
Thanks.
Alex S
Website administration is my dream job!
http://yourtechadvisors.com