Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Prevent closing fluidbox in closestart event #204

Open
babobski opened this issue Jul 1, 2020 · 1 comment
Open

Prevent closing fluidbox in closestart event #204

babobski opened this issue Jul 1, 2020 · 1 comment
Assignees
Labels

Comments

@babobski
Copy link

babobski commented Jul 1, 2020

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.

@terrymun
Copy link
Owner

terrymun commented Jul 1, 2020

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 terrymun self-assigned this Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants