How do you apply a callback (cufon) to the Galleria jquery plugin when you click on next image
-
09-10-2019 - |
Question
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();
});
OTHER TIPS
you can get the nav Dom like this and do what you want:
Galleria.ready(function(options) {
this.$('image-nav-right').click(function(){
//code
})
this.$('image-nav-left').click(function(){
//code
})
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow