set an observer to monitor onload and then do it there..
there are loads of examples of onload watches in the list history.
On Feb 8, 2008 9:17 AM, Rauan Maemirov <[EMAIL PROTECTED]> wrote:
>
> Hi, I've found that in IE setStyle() doesn't work if element is not in
> DOM yet.
>
> E.g. this code
>
> ...
> //I'm creating div through Builder.node();
>
> var pos = this.field.cumulativeOffset();
>
> div.setStyle({
> left: pos[0] + 'px',
> top: ( pos[1] + this.field.offsetHeight ) + 'px',
> width : ( Prototype.Browser.IE ) ? (this.field.offsetWidth + 'px')
> :
> (this.field.offsetWidth - 2 + 'px')
> });
>
> document.getElementsByTagName("body")[0].appendChild(div);
>
>
> works everywhere (Firefox, Opera, even Safari) except IE 7. Haven't
> tried in IE 6 yet. But I guess it would give the same result.
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---