faqts : Computers : Programming : Languages : JavaScript : DHTML

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 7 people (71%) answered Yes
Recently 1 of 3 people (33%) answered Yes

Entry

workaround? for NS bug: dynamicly replaced IMG in ILAYER inside TD does not appear until NS4 window is resized

Jul 2nd, 2001 12:20
Jean-Bernard Valentaten, Tom Hallman, Joel Sparler,


> I've run into this problem before as well with a DIV. As you 
> suggested, resizing is the key. You can "simulate" a resize by doing 
> something like this:
> document.getElementById('myElement').style.width
>   = document.getElementById('myElement').style.width;
This piece of code surly won't work in NN4, since the getElementById 
was introduced by MS with IE5 (as far as I remember it was IE5). It 
will definitely work with NN6 though, but that wasn't the question.
> This doesn't really change anything, but the browser refreshes the
> display anyway. This could cause a slight flicker, but it's better 
> than not seeing the DIV/IMG at all. 
> Also, since NS seems to be the problem here, you may want to sniff it
> out and conditionally surround the above statement ("if isNS then 
>{...} )
Well, the proper code is something more like this:
function simulatedResize()
{
  if (document.layers) //This will sort anything out but NN4.x-
  {
    document.layers['someLayer'].width = 
      document.layers['someLayer'].width;
  }
}
HTH