biati-digital / glightbox

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

If image has no extension not reconized as image #27

Closed markmangrove closed 6 years ago

markmangrove commented 6 years ago

When i paste in an image in the href without an image extension, like this for example: https://picsum.photos/1200/700/?image=40 The lightbox will be opened as a iFrame and i get (except for Chrome) unexpected styling results.

<div class="gslide-media gslide-external"><iframe class="vimeo-video gvideo iframe-ready" src="http://unsplash.it/800/600?random" style="height: 506px; width: 900px;" allowfullscreen=""></iframe></div>

If i put in an image with an extension, like this for example: https://media.architecturaldigest.com/photos/59b04f5ddd88d32f9bd9c633/master/pass/AJN_HW_Abu_Dhabi_Louvre_04%20%C2%A9%20TDIC,%20Architect%20Ateliers%20Jean%20Nouvel.jpg

It works great in all browsers and the lightbox is not in a iFrame.

<div class="gslide-media gslide-image"><img src="https://media.architecturaldigest.com/photos/59b04f5ddd88d32f9bd9c633/master/pass/AJN_HW_Abu_Dhabi_Louvre_04%20%C2%A9%20TDIC,%20Architect%20Ateliers%20Jean%20Nouvel.jpg"></div>

losbeekos commented 6 years ago

You can add data-glightbox="type: image" to your a tag so glightbox knows it's an image.