I'm using Laravel 5.8 and TinyMCE and I have added an iframe to this editor and make a new post with it.
Then at the Blade, I tried retrieving data like this:
<!-- News Content -->
<div >
{!! $new->nws_description !!}
</div>
And it correctly shows the content but the only problem is that the iframe is small size.
So I need to increase the width and height of the iframe but don't know how to do that!
Here is the contents of $new->nws_description
which is stored at the DB:
<p style="text-align: justify;">Lorem Ipsum Dolor Sit Amet</p>
<p style="text-align: justify;">Lorem Ipsum Dolor Sit Amet</p>
<p dir="ltr" style="text-align: justify;"><code></code></p>
<div style="text-align: center;"><iframe title="iframe-title" src="iframe-link" allowfullscreen="true"></iframe></div>
<p dir="ltr" style="text-align: justify;"><code></code></p>
<p dir="ltr" style="text-align: justify;"> </p>
<div id="4591871988"></div>
<div id="92356425254"></div>
So how to increase the iframe size automatically? So it would be like this:
<iframe width="100%" height="100%" ...
CodePudding user response:
Yes, it can be done using JavaScript, here you can find how to do it: https://www.w3schools.com/jsref/prop_iframe_height.asp
There are also some answer here using jquery How to increase height of tinymce Iframe?