ARIA and pagination

2019-09-10 07:51发布

问题:

I would like to get some advice on WAI-ARIA markup I have added to my paginated post navigation.

Does this look correct, am I missing anything?

Should anything be added/removed to the current page link (#2)?

Also, curious on my "Page Count" and "View All" sections what if anything can be added to make it more ARIA-friendly.

<nav role="navigation" class="post-navigation">

     <ul role="menubar" class="pagination">

        <!-- Page Count -->
        <span class="page-count">Page 2 of 4 </span>

        <li aria-label="Previous">
            <a role="menuitem" aria-posinset="1" data-pagenum="1" href="#">
                <span aria-hidden="true">«</span>
            </a>
        </li>
        <li>
            <a role="menuitem" aria-posinset="1" data-pagenum="1" href="">1</a>
        </li>
        <li class="active">
            <span role="menuitem" aria-posinset="2">2</span>
        </li>
        <li>
            <a role="menuitem" aria-posinset="3" data-pagenum="3" href="#">3</a>
        </li>
        <li>
            <a role="menuitem" aria-posinset="4" data-pagenum="4" href="#">4</a>
        </li>
        <li aria-label="Next">
            <a role="menuitem" aria-posinset="3" data-pagenum="3" href="#">
                <span aria-hidden="true">»</span>
            </a>
        </li>

        <!-- View All link handing -->
        <li aria-label="View All">
            <a role="menuitem" href="#?viewall">View All</a>
        </li>

    </ul> 
</nav>