Search code examples
javascriptjquerycufongalleria

How do you apply a callback (cufon) to the Galleria jquery plugin when you click on next image


I'm using the Galleria jquery plugin. What i would like to be able to do is apply cufon to the caption text / galleria-info-title text but i can't see how. I presume i need to add it as a callback somewhere in the galleria call but i can't see where for the life of me!

If anyone can help i would be eternally grateful!

Thank you for reading!


Solution

  • In the API reference there is a method called bind that allows you to execute a function when an event is triggered. Something akin to this:

    this.bind(Galleria.IMAGE, function() { Cufon.refresh(); });
    

    That should get you started.

    update
    I've never actually used Galleria. But, what happens when you do this:

    this.bind(Galleria.IMAGE, function(e) {
        fixCaption(e.imageTarget);
        Cufon.refresh();
    });