Skip to content

Instantly share code, notes, and snippets.

@yankiara
yankiara / oxygen-pro-menu-mobile-accessibility.js
Last active February 16, 2022 01:54
Oxygen ProMenu mobile accessibility
jQuery(document).ready(function($) {
// Initialize roles and aria attributes
$('.oxy-pro-menu-list .menu-item-has-children > a').attr('aria-haspopup','true').attr('aria-expanded','false');
$('.oxy-pro-menu-list .sub-menu').each(function(){
$(this).attr('aria-label', $(this).prev('a').text());
});
if ( $('.oxy-pro-menu-mobile-open-icon').css('display') == 'none' ) {
@somatonic
somatonic / pw_bootstrap_menu.php
Last active December 12, 2015 08:18
function to render nested Twitter Bootstrap menu markup
<?php
/**
* render markup menu for bootstrap nested navigation
*
* @param PageArray $pa pages of the top level items
* @param Page $root root page optional, if you use other root than home page (id:1)
* @param string $output for returned string collection
* @param integer $level internally used to count levels
* @return string menu html string