Magnific-Popup icon indicating copy to clipboard operation
Magnific-Popup copied to clipboard

Links to SVG images don't work

Open matbeard opened this issue 10 years ago • 4 comments

I can't get links to SVG images to display the image -- the text of the SVG is displayed instead.

I'm using something like: $(document).ready(function() { $('.image-link').magnificPopup({type:'image'}); });

The SVG images are generated by PHP, but they work if opened directly in a browser, so I can't see that being an issue.

Any suggestions?

matbeard avatar May 19 '15 11:05 matbeard

I am experiencing something similar. If the image is an SVG, the popup has the image portion of the SVG displayed faded out behind the overlay, while any text in the SVG is in clear focus as though it were the image.

steelwolf avatar Feb 09 '16 17:02 steelwolf

+1 A workaround is using type:inline and src as an html <img> tag. CSS style adjustments may be necessary.

Rikk avatar Sep 08 '16 04:09 Rikk

+1 SVG support would be great!

strarsis avatar Nov 13 '17 20:11 strarsis

It seems that one solution is to set a min-height by CSS:

.mfp-img {
    min-height: 50vh;
}

Then the SVG image at least shows up.

q2apro avatar Sep 07 '22 05:09 q2apro