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: example 1

and i'd function such: example 2

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

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -