fancybox icon indicating copy to clipboard operation
fancybox copied to clipboard

Custom style for Fancybox 3

Open sollerpolt opened this issue 8 years ago • 7 comments

Hi. I want to create lightbox with custom styling. Something like on image:

lightbox

On desktop: All elements instead of prev/next arrows are one solid element. So when I drag image, Caption, Buttons and Infobar also change their positions. Something like old Polaroid photos.

On mobile: I want to save default behavior.

Is it possible? Maybe you have useful links or advises?

sollerpolt avatar Nov 10 '18 05:11 sollerpolt

Hi,

Something like this - https://codepen.io/anon/pen/bQeXYP?editors=1010 ?

fancyapps avatar Nov 10 '18 14:11 fancyapps

Hi. Almost. I want caption also be draggable, like buttons.

Also caption should have same width as image and color background.

sollerpolt avatar Nov 10 '18 14:11 sollerpolt

There is no option available for this requirement, but it could be done like this - https://codepen.io/anon/pen/BGzXea?editors=1010

btw, sorry, I'm curious, do you really prefer this design over the default? Or this is request from your client?

fancyapps avatar Nov 10 '18 15:11 fancyapps

Great work.

https://codepen.io/anon/pen/MzjgXV/

I need to work a little on next / prev arrows, colors and paddings, but all seems fine.

Yes, I'm really prefer this design over the default. I have a travel blog. This design has some advantages:

  1. It's more colorful and bright, like my website. Default design fine for commercial website (corporate), but not for my case.
  2. Images in this design are bigger, than in default (infobar and buttons on top not use space).
  3. Usually mouse and eyes of people after click on image are somewhere near center of screen. So I need to place buttons closer to them. Less than 50% of my desktop visitors knew that they can close lightbox by clicking outside of image.
  4. Now design look like Polaroid photo with writing. It can be familiar to older visitors. caroline-anglade-cole-polaroid-left (example from web). So some people can try to manipulate images.
  5. This design not look like all another websites. Maybe it's not perfect, but someone can remember it and my site.

Tnx a lot for your help. I was trying to achieve this more than 2 weeks.

sollerpolt avatar Nov 10 '18 16:11 sollerpolt

Thanks for offering this possibility!

I added the caption option to my jAlbum FancyBox skin, see this example allbum.

BTW: the Codepen examples do contain an error, I think the last js line should be coded as:

  onUpdate: function(instance, current) {
    updatefc(instance, current);
  },

acwolff avatar Nov 12 '18 12:11 acwolff

@acwolff That's es6 syntax and works too, but I updated demo for consistency.

fancyapps avatar Nov 13 '18 10:11 fancyapps

Dreamweaver did report an error for that syntax, but it is an old version!

acwolff avatar Nov 13 '18 10:11 acwolff