function SizeAll(){alert('foo!');}
function attachEvent(){
if(document.body.addEventListener)
{
document.body.addEventListener('resize',SizeAll,false);
}
else if(document.body.onresize)
{
document.body.onresize= SizeAll;
}
else if (document.body.attachEvent)
{
document.body.attachEvent('onresize',SizeAll);
}
}
changing 'resize' to 'onresize' doesn't work either. This works in IE
and Opera. TIA.
> Is there a reason why this isn't working in Moz?
>
> function SizeAll(){alert('foo!');}
> function attachEvent(){
> if(document.body.addEventListener)
> {
> document.body.addEventListener('resize',SizeAll,false);
> }
The window is being resized so use e.g.
if (typeof window.addEventListener != 'undefined') {
window.addEventListener(
'resize',
SizeAll,
false
);
}
--
Martin Honnen
http://JavaScript.FAQTs.com/