codrops / MultiLevelMenu

A simple menu with multiple levels and an optional breadcrumb navigation and back button.
232 stars 83 forks source link

Initialize with non-root elements selected #6

Closed lakesta closed 7 years ago

lakesta commented 7 years ago

This code change solves issue #3 by allowing you to set a non-root level element to be selected easily via adding class, "menulink--current" to the current menulink item. The menu will then be initialized by opening to the proper submenu with working breadcrumbs and back buttons.

GitFrankie commented 7 years ago

This is great, but doesn't work in IE 10, 11, Edge? I understand it wouldn't work in IE 9 and below, but support for the most recent, more modern versions would be awesome.

lakesta commented 7 years ago

@GitFrankie Add this to the bottom of your ml-menu.js file and it should work in IE

(function () {
    if ( typeof NodeList.prototype.forEach === "function" ) return false;
    NodeList.prototype.forEach = Array.prototype.forEach;
})();
GitFrankie commented 7 years ago

This works! Thank you, I really appreciate the help.