var lsexample = (function() {
  'use strict';

  function init() {
    activeMenu();
  }

  function activeMenu() {
    var $itemActive = $( '[href="' + window.location.pathname + '"]', '.ls-menu' );
    $itemActive.parents('.ls-submenu').children('a').trigger('click');
    $itemActive.parent('li').addClass('ls-active');
  }

  return {
    init:init
  };

}());

$(window).load(function() {
  lsexample.init();
});

var lsexample = (function() {
  'use strict';

  function init() {
    activeMenu();
  }

  function activeMenu() {
    var path = window.location.pathname;
    path = path.replace(/\/$/, "");
    path = decodeURIComponent(path);

    $(".ls-menu a").each(function () {
        var href = $(this).attr('href');
        if (path.substring(0, href.length) === href) {
            $(this).closest('li').addClass('ls-active');
            $(this).parents('.ls-submenu').find('a').trigger('click');
        }
    });
  }

  return {
    init:init
  };

}());

$(window).load(function() {
  lsexample.init();
});

update function menuActive to examples in the documentation