Fit Iframe to an image, in a modal


Staff member
I have tried many option but nothing works.
On <a href="" rel="nofollow noreferrer">my website</a> clicking on any post open an iframe in a modal box (using <a href="" rel="nofollow noreferrer">Featherlight.js</a>) with the wordpress single.php

The problem is I can't fit the modal box to the image inside, I just decided to had sizes into the html code so far.

&lt;div id="post"&gt;
&lt;a href="#" data-featherlight="#featherlight-&lt;?php echo get_the_ID(); ?&gt;"&gt; 

        if ( has_post_thumbnail() ) {


&lt;div class="myframe"&gt;
&lt;iframe class="lightbox" src="&lt;?php the_permalink(); ?&gt;" width="400" height="600" id="featherlight-&lt;?php echo get_the_ID(); ?&gt;" style="border:none;" webkitallowfullscreen mozallowfullscreen allowfullscreen&gt;&lt;/iframe&gt;


Do you reckon it's possible using javascript or jquery?
I only know html, css and a bit of php but if I have to...