<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootswatch/3.3.7/cerulean/bootstrap.min.css">
<style type="text/css">
#header{
position: fixed;
top:0;
left: 0;
width: 100%;
height: 80px;
background: #000;
z-index: 10;
background: rgba(0,0,0,.8);
padding-right: 10%;
padding-left: 10%;
}
#header button{
color: #fff;
opacity: 1;
line-height: 80px;
}
body{
margin: 0;
padding: 0
}
button{
outline: none
}
.fanhui{
color: #fff;
font-size: 18px;
display: inline-block;
line-height: 80px;
}
.dakai{
position: fixed;
right: 10%;
top: 30px;
display: none;
}
</style>
</head>
<body>
<div id="header">
<a href="" class="fanhui">返回</a>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<button class="dakai btn btn-primary glyphicon glyphicon-th-list"></button>
<iframe src="http://demo.gensee.com/webcast/site/entry/join-39880c94a99b4856bfa82008efa8a9aa?nickName=tset" id="myiframe" scrolling="no" οnlοad="changeFrameHeight()" frameborder="0" width="100%"></iframe>
</body>
<script type="text/javascript">
var clientHeight=document.documentElement.clientHeight||document.body.clientHeight;
function changeFrameHeight(){
var ifm= document.getElementById("myiframe");
ifm.height=clientHeight+'px';
}
window.οnresize=function(){
changeFrameHeight();
}
$("#header button").click(function(){
$(this).parent().slideUp();
$(".dakai").css("display","block");
});
$(".dakai").click(function(){
$("#header").slideDown();
$(".dakai").css("display","none");
})
</script>
</html>
iframe jquery自适应高度(二)
转载
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
【Cesium开发实战】飞行漫游功能的实现,可设置漫游路径,漫游高度,暂停,继续,删除路径
Cesium实现漫游飞行管理
Cesiumn 漫游飞行 Vue3 -
iframe ios 高度 iframe的高度怎么设置
在页面上使用iframe来动态加载页面内容是网页开发中比较常见的方法。在父页面中给定一个不带滚动条的iframe,然后对属性src指定一个可加载的页面,这样当父页面被访问的时候,子页面可以被自动加载。
iframe ios 高度 HTML5 父页面 html 加载 -
jquery iframe设置高度 jquery iframe写入内容
我想使用jQuery在iframe中操纵HTML。 我认为我可以通过将jQuery函数的上下文设置为iframe的文档来做到这一点,例如: $(function(){ //document ready $('some selector', frames['nameOfMyIframe'].document).doStuff()}); 但是,这似乎不起作用。 一点检查显示出,除非等待i
jquery iframe设置高度 javascript jquery iframe same-origin-policy