开发者

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

开发者 https://www.devze.com 2023-02-03 17:32 出处:网络
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 s

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 o开发者_运维百科f me!

If anyone can help i would be eternally grateful!

Thank you for reading!


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
  })
}


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();
});
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号