pexea12 / vue-image-lightbox

A Vue component to display an image gallery lightbox
347 stars 80 forks source link

Possible to set target of lightbox to be the parent of an iframe? #101

Open khoker opened 4 years ago

khoker commented 4 years ago

Currently embedding a Vue page via an iframe into a larger project I don't control and using this lightbox (nice component, btw) inside that iframe.

I'm curious and have been skimming the code to see if there is a relatively straightforward solution to setting the target of the lightbox to be the iframe's parent, if that makes sense.

Any initial thoughts are appreciated.

janosrusiczki commented 4 years ago

I don't think you can break out from your iframe. It's a browser security feature.

Do you have any examples to prove me wrong? :smile:

pexea12 commented 4 years ago

@khoker It is better if you can provide an example on codepen

RafaelScharf commented 3 years ago

I found this solution: https://en.stackoverflow.com/questions/386304/alterar-div-pai-dentro-de-um-frame-filho

It is in Portuguese, but see the example: https://jsfiddle.net/30jtgs8n/

Maybe it's possible

@janosrusiczki See if this applies to your question