Instantly share code, notes, and snippets.
yankiara
/ oxygen-pro-menu-mobile-accessibility.js
Last active
February 16, 2022 01:54
Oxygen ProMenu mobile accessibility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
/ pw_bootstrap_menu.php
Last active
December 12, 2015 08:18
function to render nested Twitter Bootstrap menu markup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |