sub-menu.js 927 B

12345678910111213141516171819202122
  1. const subMenuOptions = document.getElementById("subMenuOptions");
  2. const subMenuOptionsTitle = document.getElementById("subMenuOptionsTitle");
  3. const subMenuOptionsTitleH3 = document.getElementById("subMenuOptionsTitleH3");
  4. const subMenuOptionsBody = document.getElementById("subMenuOptionsBody");
  5. const subMenuOptionsFooter = document.getElementById("subMenuOptionsFooter");
  6. function hideSubMenu() {
  7. subMenuOptions.style.display = 'none';
  8. }
  9. function showSubMenu() {
  10. subMenuOptions.style.display = 'inline';
  11. }
  12. // ==> Code for an class observer that is triggered every time a element style is changed <==
  13. // var observer = new MutationObserver(function (mutations) {
  14. // mutations.forEach(function (mutationRecord) {
  15. // console.log("style changed!");
  16. // });
  17. // });
  18. //
  19. // var target = document.getElementById('subMenuOptions');
  20. // observer.observe(target, { attributes: true, attributeFilter: ["style"] });