toggle on px-accordion fails and throws error in firefox browser

66 Views Asked by At

The below is the basic px-accordion tag which I am using.

<px-accordion class="start-expanded" header-value="Report">
    ....
</px>

Trying to toggle it by default on selecting the respective tab. Below is the snippet for toggle functionality.

MD.ui.panels
  .getActivePanel()
  .el.find('px-accordion.start-expanded')
  .each(function() {
    $(this)[0].toggle();
  });
};

Unfortunately, the toggle function is throwing an error in firefox browser saying "TypeError: $(...).toggle is not a function".

note: the same code is working fine in chrome. I believe in firefox, the toggle() is called before the px-accordion element loads which throws the error.

0

There are 0 best solutions below