Custom Text for Drilldown Menu "Back" Button [Foundation 6] -
while know can use data-back-button change text on drilldown menus, possible change them reflect whatever parents of drilldown is?
for example, drilldown menu works such: 
i hope makes sense , let me know if can clarify. insight can provide.
there couple of ways straightforward seems me this:
1) use foundations drilldown options set new general button. e.g. data-back-button='<li class="js-drilldown-back"><a class="new-back"></a></li>'
this takes care of styling .js-drilldown-back , makes work button without additional javascript. adds new class a later use setting text.
2) change text can use jquery, perhaps this:
$('.new-back').each(function(){ var backtxt = $(this).parent().closest('.is-drilldown-submenu-parent').find('> a').text(); $(this).text(backtxt); }); all scurry menu structure find out original link text was, , copies new button.
this should work levels of drilldown in example: http://codepen.io/tymothytym/pen/gwbxap
fyi: there few mild usability concerns using same labels point forward , backwards in menus users can find confusing, particularly many levels. may have considered this, mention completeness.

Comments
Post a Comment