<!
DOCTYPE
html>
<
html
>
<
head
>
<
title
>框架网页示例</
title
>
<
style
>
iframe {
border: none;
overflow: auto;
}
</
style
>
<
script
>
function resizeFrame(frameId, width, height) {
var frame = document.getElementById(frameId);
frame.style.width = width + 'px';
frame.style.height = height + 'px';
localStorage.setItem('frameWidth' + frameId, width);
localStorage.setItem('frameHeight' + frameId, height);
}
function lockSize() {
var frames = document.getElementsByTagName('iframe');
for (var i = 0; i <
frames.length
; i++) {
var
frameId
=
frames
[i].id;
var
width
=
localStorage
.getItem('frameWidth' + frameId);
var
height
=
localStorage
.getItem('frameHeight' + frameId);
if (width && height) {
frames[i]
.style.width
= width + 'px';
frames[i]
.style.height
= height + 'px';
}
}
}
window.onload
=
lockSize
;
</script>
</
head
>
<
frameset
cols
=
"25%,50%,25%"
rows
=
"50%,50%"
>
<
frame
src
=
"x01.htm"
id
=
"frame1"
name
=
"frame1"
scrolling
=
"auto"
/>
<
frame
src
=
"x02.htm"
id
=
"frame2"
name
=
"frame2"
scrolling
=
"auto"
/>
<
frame
src
=
"x03.htm"
id
=
"frame3"
name
=
"frame3"
scrolling
=
"auto"
/>
<
frameset
rows
=
"50%,50%"
>
<
frame
src
=
"x04.htm"
id
=
"frame4"
name
=
"frame4"
scrolling
=
"auto"
/>
<
frame
src
=
"x05.htm"
id
=
"frame5"
name
=
"frame5"
scrolling
=
"auto"
/>
</
frameset
>
</
frameset
>
</
html
>