Graeme Hackston
06-27-2002, 11:38 PM
The example below works in real time in IE. In NN6.2.1, when the window is grabbed and resized, the resize function is only executed after the mouse button is released.
Thinking it was something I was doing I downloaded Mozilla 1 to test in it and it acts exactly the same.
Is this how Mozilla reads scripts onresize? If so, is there a fix?
Thanks for your help.
<edit>Please note, there is a space (again LOL) between "java" and "script:void" in the link that needs to be removed if you test this (I can't by editing)</edit>
<html>
<head>
<title>Test</title>
<script type="text/javascript" language="JavaScript">
function getElement(id) {
if (typeof document.all != 'undefined') return document.all(id);
if (typeof document.getElementById != 'undefined') return document.getElementById(id);
if (typeof document.layers != 'undefined') return document.layers[id];
return null;
}
function showById() {
for (var a=0; a<arguments.length; ++a) {
var el = getElement(arguments[a]);
if (!el) return;
if (typeof el.style != 'undefined') el.style.visibility = 'visible';
else if (typeof el.visibility != 'undefined') el.visibility = 'show';
}
}
function hideById() {
for (var a=0; a<arguments.length; ++a) {
var el = getElement(arguments[a]);
if (!el) return;
if (typeof el.style != 'undefined') el.style.visibility = 'hidden';
else if (typeof el.visibility != 'undefined') el.visibility = 'hide';
}
}
function hide() {
hideById('test');
}
</script>
</head>
<body onresize="hide()">
<div id="test">
content content content<br>
content content content<br>
content content content
</div>
<a href="javascript:void(0);" onClick="showById('test')">show</a>
</body>
</html>
Thinking it was something I was doing I downloaded Mozilla 1 to test in it and it acts exactly the same.
Is this how Mozilla reads scripts onresize? If so, is there a fix?
Thanks for your help.
<edit>Please note, there is a space (again LOL) between "java" and "script:void" in the link that needs to be removed if you test this (I can't by editing)</edit>
<html>
<head>
<title>Test</title>
<script type="text/javascript" language="JavaScript">
function getElement(id) {
if (typeof document.all != 'undefined') return document.all(id);
if (typeof document.getElementById != 'undefined') return document.getElementById(id);
if (typeof document.layers != 'undefined') return document.layers[id];
return null;
}
function showById() {
for (var a=0; a<arguments.length; ++a) {
var el = getElement(arguments[a]);
if (!el) return;
if (typeof el.style != 'undefined') el.style.visibility = 'visible';
else if (typeof el.visibility != 'undefined') el.visibility = 'show';
}
}
function hideById() {
for (var a=0; a<arguments.length; ++a) {
var el = getElement(arguments[a]);
if (!el) return;
if (typeof el.style != 'undefined') el.style.visibility = 'hidden';
else if (typeof el.visibility != 'undefined') el.visibility = 'hide';
}
}
function hide() {
hideById('test');
}
</script>
</head>
<body onresize="hide()">
<div id="test">
content content content<br>
content content content<br>
content content content
</div>
<a href="javascript:void(0);" onClick="showById('test')">show</a>
</body>
</html>