在IE9和chrome中,按ctrl +可缩放200%:
有没有办法通过缩放功能调整帧大小?(如IE9)
参考:
答案 0 :(得分:0)
myFix.js
//fix webkit browsers
if ('WebkitAppearance' in document.documentElement.style) {
document.onreadystatechange = function() {
if (document.readyState != 'complete')
return;
var oldLevel = 1;
//whether we're fixing 'rows' or 'cols'
var checking = 'rows';
var frameset = document.getElementById('set');
//get the hard coded values from the html
var values = frameset.getAttribute(checking).split(',');
//make sure not to change any %'s or *'s
var isPixels = new RegExp('[0-9]+');
for (var index = 0; index < values.length; ++index) {
if (isPixels.test(values[index]))
values[index] = new Number(values[index]);
}
var zoomCheck = function() {
//calculate zoom level
var level = window.outerWidth / window.innerWidth;
//if it hasn't changed, ignore
if (oldLevel == level)
return;
var newValues = new Array(values.length);
//copy each of the original values
for (var index = 0; index < values.length; ++index) {
newValues[index] = values[index];
//fix the ones we are meant to
if (values[index] instanceof Number)
newValues[index] *= level;
}
//apply the fix
frameset.setAttribute(checking, newValues.join(','));
oldLevel = level;
};
//periodically check
setInterval(zoomCheck, 1000);
};
}
your.html
<html>
<head>
<!--your other stuff-->
<script type="text/javascript" src="myFix.js"></script>
</head>
<frameset id="set" rows="200,*" frameborder="0" border="0" framespacing="0">
<frame name="menu" src="menu_1.html" marginheight="0" marginwidth="0" scrolling="auto" noresize="">
<frame name="content" src="content.html" marginheight="0" marginwidth="0" scrolling="auto" noresize="">
</frameset>
</html>