Tagged: accessibility, WCAG
-
AuthorPosts
-
July 21, 2023 at 12:10 pm #1413945
For the past two weeks as I have been working on accesssibility of a website, the Twitter feed has not been working, it just gave an errror of Nothing to see here…. Today it reappeared and now, when a user tabs thru the site using a keyboard, they get kind of stuck in the twitter feed, having to tab thru a lot of feeds, starting i december 2021. That is a lot of feeds.:)
Is there a way to move the whole Twitter feed out of the tab ordre, make so that when using the keyboard it skips the whole feed?Mike provided a function that did exactly that for google maps, can something like that be done for the twitter feed?
Regards
NinaJuly 22, 2023 at 9:39 pm #1414078Hey Advantage09,
Based on the earlier script, this one works for the twitter-timeline in my tests, but unfortunately the twitter-timeline loads so slowly that I had to set the delay to 12 seconds to consistently work. The element must be loaded first for the script to work.
You can try testing with a lower number than 12000 if you wish.function skip_twitter_timeline() { ?> <script> (function($) { setTimeout(function(){ $('.twitter-timeline').each(function() { $(this).prop('tabIndex', -1); $(this).prop('aria-hidden','true'); }) $('.twitter-timeline *').each(function() { $(this).prop('tabIndex', -1); $(this).prop('aria-hidden','true'); }) },12000); }(jQuery)); </script> <?php } add_action('wp_footer', 'skip_twitter_timeline');
Best regards,
MikeJuly 23, 2023 at 11:50 pm #1414179Thank you, this worked. I will try to tweak the time a bit. If you are to fast going thru the site using a keyboard it also hits the twitter feed, but if you wait a few seconds it works like a charm.
Thanks for your support.regards
NinaJuly 24, 2023 at 11:30 am #1414205 -
AuthorPosts
- You must be logged in to reply to this topic.