Forum Moderators: open
Your tip solves NN4 onResize bug for pages without my onResize script but not those with it.
There are two issues causing my NN4 loop, as far as I can tell. The
(screen.availWidth,screen.availHeight) argument is not recognised by the browser - inclusing NN6 which overspans ca. 5%, and secondly body onResize="window.location.href = window.location.href;" conflicts with NN4's onResize bug.
As usual I want my cake and eat it!
Thanks again for the try though,
Michael O
<html>
<head>
<script type='text/javascript'>
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
var originalW, originalH;
window.onload = function() {
if (window.opera ¦¦ document.layers) {
originalW = window.innerWidth;
originalH = window.innerHeight;
setTimeout("simResizeEvent()", 500);
}
else if (window.addEventListener) {
window.addEventListener('resize', resizeListener, false);
}
else {
window.onresize = resizeListener;
}
}
function resizeListener() {
if (window.opera) location.href = location.href;
else history.go(0);
}
function simResizeEvent() {
if (window.innerWidth != originalW ¦¦ window.innerHeight != originalH) {
resizeListener();
}
else setTimeout("simResizeEvent()", 500);
}
</script>
</head>
<body marginwidth='0' marginheight='0'>
<h1>window onresize event example</h1>
</body>
</html>
Great idea to clear the loop by adding the addEventListener. NN4.79 on a Mac now opens the page as if it were NN6 - ie. over-spanned by ca. 5% but that's progress compared with its machine-crashing previous infinite-loop. Unlike NN6 it no longer resizes the page when the user resizes to adjust this overspan.
I'll go away and play with this to see what I can combine.
Thanks again for the feedback
Michael O