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

Responsive lightbox2 #641

Open
Zenju opened this issue Feb 5, 2019 · 0 comments
Open

Responsive lightbox2 #641

Zenju opened this issue Feb 5, 2019 · 0 comments

Comments

@Zenju
Copy link

Zenju commented Feb 5, 2019

Hi,

it would be great if lightbox was fully responsive on mobile with support for changing orientation while viewing an image, and without needing a page reload. After playing around a bit with CSS it does not take much to achieve this effect with CSS3.

So as some food for thought I'm adding the following solution (that I'll be using productively from now on):

`
.lightbox
{
position: fixed; /fixes (no pun intended) issue that image is not visible on mobile, when scroll pos is further down the page/
top: 30px !important;
}
.lb-outerContainer
{
display: inline-block;
width: initial !important;
height: initial !important;
}
.lb-image
{
width: initial !important;
height: initial !important;
max-width: 100% !important;
max-height: calc(100vh - 35px) !important;
}
.lb-dataContainer
{
width: initial !important;
}
.lb-details
{
text-align: center !important;
width: 100% !important;
}
.lb-close
{
display: none !important;
}

.lb-number
{
display: initial !important;
}

@media screen and (max-width: 1050px)
{
#lightbox
{
top: 0 !important;
}
}
`

And one more fix for #541
Still needed for Chrome, Android 8.1:

#lightboxOverlay
{
width: 100% !important;
height: 150% !important; /use 150% to avoid looking (temporarily) beyond bounds while scrolling/
position: fixed;
}

Result: [mobile, landscape]
1

Standard lightbox 2.10.0:
landscape issue

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

No branches or pull requests

2 participants