Announcement

Collapse
No announcement yet.

Tabbing after "skip to main content" focus is off

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Tabbing after "skip to main content" focus is off

    Tabbing after "skip to main content" focus is off
    I am trying to tab to the next item after clicking the "skip to main content" button but when I click tab it goes back to the top instead of the next item.

    This is the .js I have implemented


    $('.skipnavlink').on('focus', function() {
    $(this).removeClass('offscreen');
    });

    $('.skipnavlink').on('focusout', function() {
    $(this).addClass('offscreen');
    });

    $('.skipnavlink').on('click', function() { if ( !($(this).hasClass('offscreen')) ) { $(this).addClass('offscreen'); } if ($('#maincontent').find('input:enabled:visible').length > 0) { $('#maincontent input:enabled:visible:first').focus(); } else { $('#maincontent a:first').focus(); } $(window).scrollTop($('#maincontent').offset().top); });

  • #2
    Hi there soupi,


    unfortunately, HTMLForums is dead in all but name.

    I would suggest that you take your problem to a live forum such as...



    ~ the original bald headed old fart ~

    Comment

    Working...
    X