Change "Next"/"Previous" link titles in fancybox

brownian picture brownian · Jul 5, 2012 · Viewed 8k times · Source

I am trying (with fancybox 2.0.6) to change link titles ('Next', 'Previous') to something different:

beforeLoad: function() {
      jQuery('.fancybox-next').each(function() {
        var $this = jQuery(this);
        $this.attr('title', 'Далі');
      });
    }

Please, what is wrong? Am I trying to use right callback? Something else?

Thanks!

Answer

JFK picture JFK · Jul 8, 2012

Change the title attribute of next and prev links using the tpl option this way

$("a.fancybox").fancybox({
 tpl: {
  next: '<a title="Siguiente" class="fancybox-nav fancybox-next"><span></span></a>',
  prev: '<a title="Anterior" class="fancybox-nav fancybox-prev"><span></span></a>'
 }
}); // fancybox