biati-digital / glightbox

Pure Javascript lightbox with mobile support. It can handle images, videos with autoplay, inline content and iframes
MIT License
2.03k stars 228 forks source link

Image height and width not working #419

Open ramoshe opened 1 year ago

ramoshe commented 1 year ago

Describe the bug Using the "data-width" and "data-height" properties for the slide does not seem to be working.

Are you able to reproduce the bug in the demo site Yes

To Reproduce Steps to reproduce the behavior:

  1. Add "data-width" and "data-height" properties to a gallery slide.

Expected behavior Slides should be restricted to the width and height set (I tried 80%, 80vw/vh, pixels, ems)

Post the code you are using

    <a
        class="glightbox"
        href="https://res.cloudinary.com/theramoshe/f_auto/${image}.jpg"
        data-glightbox="title: ${title}; description: ${caption};"
        data-type="image"
        data-width="80%"
        data-height="80%"
    >
        <img
            class="gallery-image"
            src="https://res.cloudinary.com/theramoshe/f_auto/${image}"
            alt="${title}"
        />
    </a>`;

Screenshots If applicable, add screenshots to help explain your problem.

Desktop:

Smartphone: N/A

zumbidoweb commented 1 year ago

use viewport dimesions data-width="80vw" data-height="80vh"

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.