francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.65k stars 165 forks source link

overlay and image divs appended before closing body tag #37

Closed selfagency closed 6 years ago

selfagency commented 6 years ago

so this is weird—

      mediumZoom('[data-action="zoom"]', {
        container: ('#zoom-container'),
        background: bgColor,
        margin: 40
      })

when i click on an image, my specified container is completely ignored and the overlay and image are inserted before the closing body tag. the image is also repeated twice.

screenshot 2018-02-22 21 41 52

francoischalifour commented 6 years ago

Hi @selfagency, did you style your #zoom-container? You need to specify its dimensions with CSS attributes. Also, note that you don't need the parentheses around your selector.

If you need further support, please provide a reproducible example on Codepen for example.