Skip to content

Instantly share code, notes, and snippets.

@dislokacia
Created July 19, 2022 21:23
Show Gist options
  • Select an option

  • Save dislokacia/b44790c16fadbeec161238180fb19eb6 to your computer and use it in GitHub Desktop.

Select an option

Save dislokacia/b44790c16fadbeec161238180fb19eb6 to your computer and use it in GitHub Desktop.

Revisions

  1. dislokacia created this gist Jul 19, 2022.
    23 changes: 23 additions & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    jQuery(document).ready(function( $ ){
    init();
    $( document ).on( 'jet-filter-content-rendered', function() {
    setTimeout(function() {
    init();
    $('.jet-filters-pagination__current .jet-filters-pagination__link').attr('aria-pressed', 'true');
    }, 1);
    });

    function init(){
    $('.jet-filters-pagination__link').each(function(){
    $(this).attr('role', 'button');
    $(this).attr('aria-pressed', 'false');
    $(this).attr('tabindex', '0');
    });
    $(".jet-filters-pagination__link").on('keypress',function(e) {
    if(e.which === 13 || e.which === " " || e.which === "Spacebar" ) {
    $(this).trigger('click');
    };
    });
    };

    });