Keyboard Focus (accessibility)
-
Hallo Frank,
is there a chance to become YouTube Lyte embeds managed with the tab?
I tried following Code-Snippets, but no chance:
Theme: GeneratePress with GenerateBlocks
Code in function.php from Childtheme:// Allow keyboard focus on Youtube Lyte add_filter( 'lyte_match_postparse_template', function( $lytetemplate ) { $lytetemplate = str_replace( ' class="lyte-wrapper">', ' class="lyte-wrapper" role="button" aria-label="play video" tabindex="0">', $lytetemplate ); return $lytetemplate; }); And two different tries of scripts in footer: the first for video: document.addEventListener('keydown', function(event) { if (event.key === 'Enter' || event.key === ' ') { var lyteWrapper = document.querySelector('.lyte-wrapper'); if (lyteWrapper && document.activeElement === lyteWrapper) { lyteWrapper.click(); } } }); The second, to get the picture: document.addEventListener('keydown', function(event) { if (event.key === 'Enter' || event.key === ' ') { var lyteImage = document.querySelector('#lyte_sWNUYPekxT0'); // Nach ID suchen // oder // var lyteImage = document.querySelector('.pL'); // Nach Klasse suchen if (lyteImage && document.activeElement === lyteImage) { lyteImage.click(); } } }); But nothng works. Maybe you have an idea, how to get the videos accessible? thanks in advance, Stephan
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Keyboard Focus (accessibility)’ is closed to new replies.