直播视频app源码,js设置iframe高度无效
直播视频app源码,js设置iframe高度无效实现的相关代码
iframe.content{ width: 1000px; min-height: 1510px; margin-left: 25%; margin-top: -180px; }
在css已经确定的情况下用以下js代码无法设置iframe的高度
function ifmin(){ document.getElementById("cont").height=910+'px'; }
解决办法:
css中不设置iframe的高度,通过onload设置iframe的高度
function ifload(){ document.getElementById("cont").height=1510+'px'; } <body onload="ifload()">
js代码就能生效了
function ifmin(){ document.getElementById("cont").height=910+'px'; }
以上就是直播视频app源码,js设置iframe高度无效实现的相关代码, 更多内容欢迎关注之后的文章