fancyapps / ui

A library of JavaScript UI components, includes the best lightbox - Fancybox5
https://fancyapps.com/
Other
814 stars 98 forks source link

Custom template for prev/next buttons #686

Closed tolchai closed 2 months ago

tolchai commented 2 months ago

Describe the bug

Hi,

I am probably missing something very obvious, but is there a way to customize template for prev/next buttons?

I am unable to do that with tpl object (seems to manage only main and closeButton) and it works within Toolbar.items.prev and Toolbar.items.next only if those are actually added to Toolbar.

Reproduction

Default functionality

Additional context

No response

fancyapps commented 2 months ago

Hi, Here is an example:

Fancybox.bind('[data-fancybox="gallery"]', {
  Carousel : {
    Navigation : {
      nextTpl: "Next page",
      prevTpl: "Previous page",
    }
  }
});    

https://jsfiddle.net/z5p13kht/