Skip to content

How to prioritize slides in the gallery? #386

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

You must be logged in to vote

Hi,

Well, there is no built-in mechanism to customize order of the slides, gallery items have the same order as their corresponding links in the DOM . However, the solution is to use API to start Fancybox programmatically:

  1. Add your click event to your links;
  2. Within click event, get all your links (in the order you need) and determine index of start item;
  3. Start Fancybox using API (for example, Fancybox.show([{src: IMG_SRC, $thumb: THUMBNAIL}]), see docs for your version of Fancybox)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gordinski
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants