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

Next/Previous image overlap main image #18

Open
bmomjian opened this issue Mar 29, 2023 · 1 comment
Open

Next/Previous image overlap main image #18

bmomjian opened this issue Mar 29, 2023 · 1 comment
Assignees

Comments

@bmomjian
Copy link

On small screens like mobile phones, when viewing a main image (not an index of images), the next/previous images appear on top of the main image. I was able to make next/previous images invisible if they overlap the main image by adding this to SHARED_basic.css:

div#image_img img {
                position: relative;
                z-index: 1;
}

This is for lazygal version 0.10.2.

@bmomjian
Copy link
Author

I ended up changing my approach by forcing lazygal prev/next images to be below main image, not over it
and force the main image to not exceed the screen width and height. It appears lazygal was never designed to work on mobile where the screen width is often < 1324; this addition to SHARED_basic.css improves that:

/* 1324px is where prev/next images start to overlap the main image */
@media (max-width: 1324px) {
    /* prevent image from exceeding screen width and height */
    div#image_img img {
        width: auto;
        max-width: 100vw;
        height: auto;
        max-height: 100vh;
    }

    /* change from "absolute", use !important to override */
    div.prevnext {
        position: relative !important;
    }

    div#prev_link {
        float: left;
    }

    div#next_link {
        float: right;
    }
}

@niol niol self-assigned this Aug 4, 2023
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