I’m building out a module that needs to initiate a slider. Something similar to this:
jQuery('#slider').anythingSlider();
I can do that as long as I only have one module on the page, but if I add more than one module to the page, it will only add the last script declaration. The reason I need to cal this more than once is to have more than one slider on the same page, each with their own options (there’s a plethora of options).
I’ve tried scriptDeclaration and I’ve even tried echoing the script to see if it would allow it to be echoed.
I’m am building on Joomla 1.7.3. This is isn’t the first time I’ve had this problem, but this is the first time it’s absolutely necessary to get this working correctly.
Thanks!
There are a number of things you could do:
1) use a class declaration to initialise your slider
Now, all containers with the “slider”-class will be processed by the plugin.
2) just use different id’s for your html containers.
Im not sure, what the exact html markup is, that your plugin requires, but something like this should work.
In your default.php (template):
The second option would be better, since it would allow you to use different configurations for wach slider. Hope this helps.