How to move iframe along the DOM without losing it's content?

前端 未结 1 672
误落风尘
误落风尘 2021-01-18 09:14

Is it possible?

I have tried to move it, but iframe contents dissapear.

Tried to get contents of iframe and place them in the new place but all handlers ofc

1条回答
  •  野的像风
    2021-01-18 09:54

    I believe that items in an iframe aren't bound unless done so explicitly in that iframe. in other words, the iframe contents don't inherit the binding events from the parent window. you will have to bind first in the iframe and then move stuff around.

    i think.

    EDIT

    I think you may want to do something like

    its_body = its_contents.find("div:first").clone(true);
    $(its_body).insertAfter(cthis.find('#photos'));
    

    0 讨论(0)
提交回复
热议问题