Jquery Accordion Destroy Function Error after Upgradeing Jquery

ThemeBurn SupportForumsOpenCart ThemesShoppica 2 OpenCart ThemeJquery Accordion Destroy Function Error after Upgradeing Jquery

This topic has been marked as not resolved.

I am working on OC 1.5.6.5 with Shoppica2 2.2.4 and I have been researching the console error I started receiving after upgrading my Jquery lib past 1.9 which is:

I have been researching the console error I started receiving after upgrading my Jquery lib past 1.9 which is:

“Uncaught Error: cannot call methods on accordion prior to initialization; attempted to call method ‘destroy’”

I understand it has to do with the timing of the library loading and the function running at the wrong time or due to the accordion being empty I believe from my research, but I have not been able to find a working way to rewrite this code to work. Any suggestions or workarounds for this?

jQuery( function($) {

  function set_product_info() {
    var w = $("html").width();
    if (w < 768) {
      $(".s_tabs").tbTabs("destroy");
      $(".s_tab_box").accordion ({
        autoHeight:         false,
        collapsible:        true,
        active:             false
      });
    }
    else {
      $(".s_tab_box").accordion("destroy");
      $(".s_tabs").tbTabs({ fx: { opacity: 'toggle', duration: 300 } });
    }
  } 

December 10, 2020 at 9:53 pm #68025
Viewing 1 post
  • You must be logged in to reply to this topic.