最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

SlickNav - Google Lighthouse Accessibility issue for collapsed menu button

programmeradmin3浏览0评论

I use Slicknav for my mobile menu, and Lighthouse flags up the following:

Links do not have a discernible name - a.slicknav_btn.slicknav_collapsed

I assume it means this element

<a href="#" aria-haspopup="true" tabindex="0" class="slicknav_btn slicknav_collapsed"><span class="slicknav_menutxt">MENU</span><span class="slicknav_icon"><span class="slicknav_icon-bar"></span><span class="slicknav_icon-bar"></span><span class="slicknav_icon-bar"></span></span></a>

Diving into the slicknav.js, I was thinking this is the correct portion of the code? I am trying to work out how to modify this to produce the correct label but so far I just get errors.

    iconClass = prefix + '_icon';

    if (settings.label === '') {
        iconClass += ' ' + prefix + '_no-text';
    }

    if (settings.parentTag == 'a') {
        settings.parentTag = 'a href="#"';
    }

Any ideas on how to fix this?

发布评论

评论列表(0)

  1. 暂无评论