增加iframe自适应高度
This commit is contained in:
parent
2792356db8
commit
ea5229cfbe
|
@ -1,4 +1,12 @@
|
|||
$(function () {
|
||||
var fra = $('iframe').get(0);
|
||||
fra.height = fra.contentDocument.body.offsetHeight;
|
||||
$(function () {
|
||||
function iframeResposive() {
|
||||
try {
|
||||
var fra = $('iframe').get(0);
|
||||
fra.height = fra.contentDocument.body.offsetHeight;
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
}
|
||||
$(window).on('load', iframeResposive);
|
||||
$(window).on('resize', iframeResposive);
|
||||
});
|
Loading…
Reference in New Issue