Fit Iframe to an image, in a modal

admin

Administrator
Staff member
I have tried many option but nothing works.
On <a href="http://www.skuar.com" rel="nofollow noreferrer">my website</a> clicking on any post open an iframe in a modal box (using <a href="http://noelboss.github.io/featherlight/" 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.

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

        &lt;?php
        if ( has_post_thumbnail() ) {
        the_post_thumbnail('post-thumbnails');
        }
        ?&gt;  

    &lt;/a&gt;

&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;
&lt;/div&gt;

&lt;/div&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...

Thanks!