Skip to content

Config option to replace prev and next arrow button SVGs? #461

Answered by fancyapps
melbazany asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

Fancybox5 is built around the Carousel component, and the navigation arrows are simply created using the Carousel Navigation plugin. So, you can customize their template like this:

Fancybox.bind('[data-fancybox="gallery"]', {
  Carousel : {
    Navigation: {
      prevTpl:
      '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M11 5l-7 7 7 7"/><path d="M4 12h16"/></svg>',
      nextTpl:
      '<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M4 12h16"/><path d="M13 5l7 7-7 7"/></svg>',
    },
  }
});  

Quick tip: use CSS variables to customize colors, dimensions, etc, example:

.fancybox__nav {
  --f…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@melbazany
Comment options

Answer selected by melbazany
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants