Skip to content

[docs] Improve lightbox behavior: allow closing by clicking anywhere #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zihanKuang
Copy link
Contributor

This pull request improves the behavior of the lightbox modal used for image enlargements.

Previously, users could only close the modal by clicking the "close" button or pressing the Escape key.
With this change, users can now close the lightbox by clicking anywhere on the modal overlay, including both the background area and the image itself. This improvement makes the interaction more intuitive and user-friendly.

Changes

Added an event listener to the #myModal element to close the modal when clicking anywhere inside it.

Signed commits

  • Yes, I signed my commits.

Copy link

netlify bot commented Apr 27, 2025

Deploy Preview for bejewelled-pegasus-b0ce81 ready!

Name Link
🔨 Latest commit 3324c15
🔍 Latest deploy log https://app.netlify.com/sites/bejewelled-pegasus-b0ce81/deploys/680e176ec7285b0008c2aa76
😎 Deploy Preview https://deploy-preview-508--bejewelled-pegasus-b0ce81.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@zihanKuang zihanKuang requested a review from vishalvivekm April 28, 2025 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant