iframe高度控制 asing1elife | 2016-12-13 | html , iframe 版权声明:本文首发 http://asing1elife.com ,转发请注明出处,讲文明懂礼貌! iframe在ios的safari中无法通过height:100%控制高度 在iframe中加上scrolling=”no”强制没有滚动条 12<iframe id="courseContentFrame" name="courseContentFrame" src="JavaScript:;" scrolling="no"> </iframe> 在iframe动态加载内容后,通过js强制指定高度 1234var height = $courseLearningPanel.find(".course-content-panel").height(); $courseContentFrame.attr("height", height); $courseContentFrame.css("min-height", height + "px !important"); $courseContentFrame.css("max-height", height + "611px !important");