francoischalifour / medium-zoom

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

Img view node add location #162

Closed ghost closed 3 years ago

ghost commented 3 years ago

Can I change the position where the node is added? I want to add it to a node Snipaste_2020-10-26_13-12-55

francoischalifour commented 3 years ago

Hey! You can use the container option for this.

ghost commented 3 years ago

My expectation is that the rendered <div> and <img> should be placed in #zoom-container instead of placed in the child nodes of <body> . Did I make a mistake? Snipaste_2020-10-26_21-02-37

francoischalifour commented 3 years ago

Gotcha, my bad. The zoomed image is appended to the body and there's no option for that.

Why do you need to append the image to another DOM element?

ghost commented 3 years ago

I just want to embed it into the expected node to achieve other effects. If not, I will think of other ways, thank you