Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
45 lines (43 loc) · 1.83 KB
/
Copy pathindex.html
File metadata and controls
45 lines (43 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE HTML>
<html>
<head>
<title>VimScript Collect</title>
<script type="text/javascript" language="javascript">
//
function iFrameHeight(){
var ifm = document.getElementById("iframepage");
var subWeb = document.frames? document.frames["iframepage"].document:ifm.contentDocument;
if(ifm != null && subWeb != null){
ifm.height = subWeb.body.scrollHeight;
}
}
//
function dynIframeSize(ifmId){
var ifm = null;
if(document.getElementById){
ifm = document.getElementById(ifmId);
}else{
eval('ifm = '+ifmId+';');
}
if(ifm && !windown.opear){
ifm.style.display="block";
console.log(ifm.height);
console.log(ifm.width);
if(ifm.contentDocument && ifm.contentDocument.body.offsetHeight){
ifm.height = ifm.contentDocument.body.offsetHeight + 20;
ifm.width = ifm.contentDocument.body.scrollWidth + 20;
}else if(ifm.Document && ifm.Document.body.scrollHeight){
ifm.height = ifm.Document.body.scrollHeight;
ifm.width = ifm.Document.body.scrollWidth;
}
console.log(ifm.height);
console.log(ifm.width);
}
}
</script>
</head>
<body>
<iframe id="iframepage" name="iframepage" src="http://www.sina.com.cn" frameBorder=0 scrolling=no marginheight="0" width="100%" height="100%" minwidth="100%" minheight="100%" onLoad="javascript:dynIframeSize(this);">
</iframe>
</body>
</html>