21 April 2021

Responsive iFrame and make iframe height dynamic based on content inside- JQUERY/Javascript

 Responsive iFrame and make iframe height dynamic based on content inside- JQUERY/Javascript


https://stackoverflow.com/questions/9162933/make-iframe-height-dynamic-based-on-content-inside-jquery-javascript


'Rather than using javscript/jquery the easiest way I found is:

<iframe style="min-height:98vh" src="http://yourdomain.com" width="100%"></iframe>
Here 1vh = 1% of Browser window height. So the theoretical value of height to be set is 100vh but practically 98vh did the magic.

'


No comments:

Post a Comment