jqueryexample.com jQuery - iframe height auto adjust - jqueryexample.com

jQuery – iframe height auto adjust by jqueryuser

I used a solution for auto adjust height of iframe to fit with content in it. This is a good solution to solve the problem completely and it’s simple.

$(function () {

            $('#myIframe').load(function () {
                this.style.height =
                 this.contentWindow.document.body.offsetHeight + 'px';
            });
});
Did you like this? Share it:

Discussion

No comments yet, be the first.

Leave a Comment