fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

Grouping "inline" doesn't work with two items, only three or more

Open jvwrx opened this issue 8 years ago • 1 comments

I'm trying to have 2 grouped "inline" elements (that loop and work with the keyboard), but when you use the keyboard or arrows the content is oddly hidden and often the "requested content cannot be loaded" error appears.

I've created a reduced test case forked from your inline demo here: https://s.codepen.io/mrjustin/debug/jxRWEQ.

The issue is fixed when you remove "loop: true" from the above demo OR if you add more "inline" elements, such as here: https://s.codepen.io/mrjustin/debug/XqQXjJ

Is this a bug or am I doing something wrong? (Thanks so much for your work on this fantastic script. Your docs are great and except for this one issue I've been very appreciative of it!)

jvwrx avatar May 22 '18 20:05 jvwrx

Hi,

This has been improved in the latest version (v3.4.1) - https://codepen.io/anon/pen/XPjZBw?editors=1010

Keep in mind that the requirement to display 2 inline items in the swipeable gallery contradicts the idea of the "inline content". You see, to make gallery look nice while swiping, we need at least 3 slides [previous]current]next]. This works well for images, you can see next/prev image while swiping. But the idea of inline content is that fancybox moves element into the fancybox and places back in the place after closing. Obviously, one element can only be in one place at a time. But what if we have 3 slides and two elements? Right now, 2nd element will be placed in the next slide and will jump to previous slide, if needed (e.g., if user swipes to previous gallery item).

fancyapps avatar Aug 31 '18 13:08 fancyapps