Skip to content
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

Customize lightbox size #71

Open
TheElectroclassics opened this issue Nov 30, 2023 · 1 comment
Open

Customize lightbox size #71

TheElectroclassics opened this issue Nov 30, 2023 · 1 comment

Comments

@TheElectroclassics
Copy link

Is there a way to customize the lightbox's size? It defaults to a 16:9 viewport, but I want it to use the whole height of the page and maybe 50~80% of the viewport, so it looks best on mobile and desktop, is there a way to customize it through CSS or is it baked into the JS?

@VTANS
Copy link

VTANS commented Jan 7, 2024

The same problem here, using the html code described at the Options page:

import Lightbox from 'bs5-lightbox';

const options = {
	keyboard: true,
	size: 'fullscreen'
};

document.querySelectorAll('.my-lightbox-toggle').forEach((el) => el.addEventListener('click', (e) => {
	e.preventDefault();
	const lightbox = new Lightbox(el, options);
	lightbox.show();
}));

changing the values for parameter size like described (sm,lg,xl,fullscreen), but there is no difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants