Loading...
 
Skip to main content

Features / Usability


Re: Re: All javascript disappears when trying to add a jquery plugin

Jonny Bradley wrote:

Hi Limen

It is possible to add extra jQuery plugins to Tiki - how and where are you including the extra library? It might failing be because the extra plugin is getting loaded before jQuery. Try using $.getScript in a {JQ} block (which runs on doc.ready by default for you) and do your initialisation inside the callback.

Your code looks ok - but also you might try Firefox with Firebug installed to break on JS errors (useful in general)

Good luck!

jonny


Thank you!

You were right, apparently it wasn't necessary to include the libraries in the header.tpl or use the Custom End of body Code

It seems so simple now:

Copy to clipboard
{JQ()}$.getScript('lib/jquery/carouFredSel/carouFredSel-4.0.3/jquery.carouFredSel-4.0.3-packed.js', function() { $(document).ready(function() { // Using default configuration $("#foo").carouFredSel(); // Using custom configuration $("#foo2").carouFredSel({ items : 2, direction : "up", scroll : { items : 1, effect : "easeOutBounce", duration : 1000, pauseOnHover : true } }); }); });{JQ} {HTML()} c a r o u F r e d S e l {HTML}