Fluidbox icon indicating copy to clipboard operation
Fluidbox copied to clipboard

Prevent closing fluidbox in closestart event

Open babobski opened this issue 4 years ago • 1 comments

I'm currently implemented fluidbox in a new web project, I'm combining it with a jquery zoom plugin. It works great only when I zoom out of the image, fluidbox closes because the drag for the zoom is a click event for fluidbox.

I was hoping I could do a event.preventDefault in the closestart.fluidbox event, but this is not working.

babobski avatar Jul 01 '20 13:07 babobski

This feels like an XY problem: the closestart event is fired because closing has already been initiated: so conceptually it is already too late to stop closing at this point.

Instead, you might want to prevent the click event from propagating from the jQuery zoom plugin instead. In that sense, the click event does not bubble up to the fluidbox DOM and therefore will not be caught and trigger closing.

terrymun avatar Jul 01 '20 14:07 terrymun