javascript - Fancy box not opening iFrame second time -


first post - hello! use fancybox (fancybox homepage) display modal windows. i'm trying display hidden div iframe inside of div. works great. second time click link, doesn't load iframe (not 404 error, there no content in iframe). can help?

the important bits:

<script type="text/javascript"> function openiframelink() {     $.fancybox({         'type'          : 'inline',         'href'          : '#data'     }); }; </script> 

and html:

<div id="hiddenelement">     <iframe id="data" src="frames/frame4.php" width="100%" height="300"></iframe> </div> 

it looks fancybox extracts iframe element dom , puts it's own container. then, when close fancybox, attempts insert - manages loose src attribute value.

the fancybox guy's approved method of opening iframe seems following.

<a id="mylink" class="iframe" href="frames/frame4.php">mylink</a> <script type="text/javascript">     $("#mylink").fancybox(); </script> 

one way circumvent it, clone iframe element, i.e.

function openiframelink() {     $.fancybox( {content: $('#data').clone()} ); } 

obviously not ideal.. i'd love hear more familiar chime in.


Comments

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -