Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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
    Nina

    #1414078

    Hey 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,
    Mike

    #1414179

    Thank 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
    Nina

    #1414205

    Hi,

    Great, I’m glad that Mike could help you out. Please let us know if you should need any further help on the topic, or if we can close it.

    Best regards,
    Rikard

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.