var self = this
reinitIframe = function () {
var hotel = $("#test")
var height = hotel.contents().find(“body”).height()
self.height = height
console.log(height)
}
window.setInterval(“reinitIframe()”, 200);
iframe父页面获取子页面高度
最新推荐文章于 2022-09-07 10:50:57 发布
博客内容为一段JavaScript代码,定义了reinitIframe函数,用于获取id为test的元素内容中body的高度,并将其赋值给self的height属性,同时使用window.setInterval方法每200毫秒调用一次该函数。
932

被折叠的 条评论
为什么被折叠?



