I have a problem with JQuery and plugins with which I do not get on and hope for help. Specifically it is about a rather small JQuery plugin that displays tabs or an accordion depending on the screen resolution (https://www.jqueryscript.net/accordion/Tiny-Flexible-jQuery-Responsive-Tabs-Plugin-mTab.html).
The order in which the plugin needs to be loaded is:
- HTML DOM
- CSS mTab
- JQuery
- JavaScript for mTab (minified)
- function call
The HTML DOM is generated in the theme “show.phtml”, CSS and JQuery I load via the layout.phtml
How and where do I have to integrate the plugin (a minified.JS) and then make the function call? Also in the layout.phtml? What command do I need to use to make sure the plugin is not loaded until JQuery is already there. Is it enough to write:
$this->headScript()->appendFile($this->assetUrl('js/jquery-mTab-min.js'));
in the last place?
The function call then as last in the Show.phtml, or? Does this just go inside a tag or does Omeka block this?
Unfortunately, I currently always get the error
TypeError: mTab(...) is not a function
so I suspect the call is failing and the order of how my JavaScript is loaded is wrong.
Thanks for tips and help