check if jQuery UI tabs have been initialized (without checking for class)

后端 未结 2 888
悲哀的现实
悲哀的现实 2021-01-03 23:36

Using jQuery UI tabs - and I\'ve written a plugin that integrates with ui tabs. I\'ve got the plugin setup to initiate jQuery UI tabs if it .tabs() hasn\'t been

2条回答
  •  情话喂你
    2021-01-03 23:57

    somehow it causes some error when i try to check the instance.

    i need to reinitialize the tabs and for me a try catch did the trick:

    try {
        $('.mytabs').tabs('destroy');
    } catch (exception) {}
    

    and after that just initialize again:

    $('.mytabs').tabs();
    

提交回复
热议问题