Make menu header a link to its first child link
We use menu block a lot to create sidebar menus with specific depths, starting points, etc. The following snippet shows how we can use jQuery to turn a normal <h2> tag into a link. The link’s destination will be the same as the first child link.
1 2 |
var href = $('#block-menu_block-1 h2.title').next().find('li a').attr('href'); $('#block-menu_block-1 h2.title').html($('<a></a>').html($('#block-menu_block-1 h2.title').html()).attr('href', href)); |