fancyapps / ui

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

Fancybox - Next picture when you click on the picture #624

Closed MrKlarki closed 8 months ago

MrKlarki commented 8 months ago

Is your feature request related to a problem? Please describe.

Hi! :)

There may already be such functionality. When you click on the picture, it will switch to the next picture

Describe the solution you'd like

Click on the current picture to switch to the next one

An example in the video. I click on the picture with the mouse to switch to the next picture https://youtu.be/p3vUHVDvI9k

Describe alternatives you've considered

No response

Additional context

No response

fancyapps commented 8 months ago

Hi,

There is a contentClick option for this (https://fancyapps.com/fancybox/api/options/#contentclick), use it like this - https://jsfiddle.net/df70pnc6/

Fancybox.bind('[data-fancybox="gallery"]', {
  contentClick: "next"
}); 
MrKlarki commented 8 months ago

Thank you very much! :)

I really like this library