[thelist] Script to fix Netscape CSS-P bug?
martin burns
martin at lists.evolt.org
Wed Oct 4 02:10:19 CDT 2000
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
At 08:00 03/10/00, Ben Henick wrote:
>When the user resizes their window, Netscape naturally trashes the
>whole thing. So I set the page to refresh for Netscape users.
>
>However, I know there's a script to work around this problem...
>
>Does anybody know where I can find an example of this script?
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
function WM_netscapeCssFix() {
// This part was inspired by Matthew_Baird at wayfarer.com
// It gets around another unfortunate bug whereby Netscape
// fires a resize event when the scrollbars pop up. This
// checks to make sure that the window's available size
// has actually changed.
if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth
|| document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {
document.location = document.location;
}
}
function WM_netscapeCssFixCheckIn() {
// This function checks to make sure the version of Netscape
// in use contains the bug; if so, it records the window's
// width and height and sets all resize events to be handled
// by the WM_netscapeCssFix() function.
if ((navigator.appName == 'Netscape')
&& (parseInt(navigator.appVersion) == 4)) {
if (typeof document.WM == 'undefined'){
document.WM = new Object;
}
if (typeof document.WM.WM_scaleFont == 'undefined') {
document.WM.WM_netscapeCssFix = new Object;
document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;
document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;
}
window.onresize = WM_netscapeCssFix;
}
}
WM_netscapeCssFixCheckIn()
//-->
</SCRIPT>
________________
Martin Burns, Content Management Consultant
tel: +44 (0)778 068 6418
http://evolt.org/index.cfm?menu=9&uid=32
http://www.easyweb.co.uk/
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 6.5.3 for non-commercial use <http://www.pgp.com>
Comment: PGP Key ID: 0xA835CCCB
iQA/AwUBOdmMUnHoHnCoNczLEQIKGQCgl6A1VQQ0+yk1Pb6aHvi0Hx+5P20An3Cz
5I/b/PcwLzHwY9fwqGm9L5Xi
=GYBd
-----END PGP SIGNATURE-----
More information about the thelist
mailing list