Hi,
I'm using DMW MX2004 to create a website for my organization. Just recently the cross-browser issue came to me. I tested the page with the newly installed Firefox and it didn't appear the way it's supposed to.
Below is the code for centering the <div> on the page. It works just fine with IE, but not with Firefox. I heard Firefox incorporated document.all last year. It shouldn't be the case (or so I thought).
Could anyone see why it doesn't work with Firefox?
Thanks for any advice!
-----------------------
function BW_centerLayers() {
if (document.layers || document.all || document.getElementById){
var winWidth, winHeight, i, horz, vert, width, height, offsetX, offsetY, negX, negY, group, x, y, args;
args = BW_centerLayers.arguments;
onresize = BW_reload;
winWidth = (document.all)?document.body.clientWidth:window.innerWidth;
winHeight = (document.all)?document.body.clientHeight:window.innerHeight;
for (i=0; i<(args.length-9); i+=10) {
horz = args[i+1];
vert = args[i+2];
width = parseInt(args[i+3]);
height = parseInt(args[i+4]);
offsetX = parseInt(args[i+5]);
offsetY = parseInt(args[i+6]);
negX = args[i+7];
negY = args[i+8];
x = ((winWidth - width)/2) + offsetX;
y = ((winHeight - height)/2) + offsetY;
x = (negX=='false' && (x < 0))?0:x;
y = (negY=='false' && (y < 0))?0:y;
layerObj = (document.getElementById)?document.getElementById(args):MM_findObj(args);
if (layerObj!=null) {
layerObj = (layerObj.style)?layerObj.style:layerObj;
layerObj.left = (horz=="true")?x:layerObj.left;
layerObj.top = (vert=="true")?y:layerObj.top;
}
}
}
}