Thanks Tobie,

So what would you say would be the best style to use?

keith

On Feb 15, 4:39 pm, Tobie Langel <[EMAIL PROTECTED]> wrote:
> To clarify:
>
> $() extends elemets for you and so does every other DOM related
> methods in Prototype.
>
> using "new Element('div', {attributes...})" instead of
> "document.createElement('div')" also solves that problem.
>
> when you store an element inside of a class, do this:
>
> this.element = $(element);
>
> like that you're keeping a reference to the extended element.
>
> Best,
>
> Tobie
>
> On Feb 15, 10:21 pm, pwnedd <[EMAIL PROTECTED]> wrote:
>
> > Thanks Tobie,
>
> > That was really helpful :) The Element functionality now works fine in
> > ie
> > if I use either the "Element.function(myElement)" syntax, or use
> > Element.extend(myElement); prior
> > to calling the function.
>
> > In case anyone is interested, the problem is more general than just
> > affecting setStyle. I also
> > ran into similar issues when using hide() under certain contexts. Here
> > are two of the cases
> > where the functions would not cooperate in ie7 on windows:
>
> > 1. Calling element.setStyle on an element after creating it using
> > document.createElement (see above).
> > 2. Calling element.hide() on an object instance variable (e.g.
> > this.myVariable.hide()).
>
> > -Keith
>
> > On Feb 15, 3:45 pm, Tobie Langel <[EMAIL PROTECTED]> wrote:
>
> > > Have a look at this:http://prototypejs.org/learn/extensions
>
> > > Should help you solve your problem.
>
> > > Best,
>
> > > Tobie
>
> > > On Feb 15, 9:33 pm, pwnedd <[EMAIL PROTECTED]> wrote:
>
> > > > I have also run into similar troubles with IE. I would like to do
> > > > something like:
>
> > > > var myDiv = document.createElement("div");
> > > > div.setStyle({backgroundColor:'#000000'});
>
> > > > However, the above code produces an error in ie7 ("object doesn't
> > > > support this property or method.")
>
> > > > I *can* get it to work using Element.setStyle(div, {...}), but does
> > > > anyone know why the former doesn't work,
> > > > or how I could get it to work? You mentioned above setting an event
> > > > handler for onLoad. The above
> > > > occurs after the document has loaded and onLoad has been fired so I
> > > > don't think that will help.
>
> > > > Any advice would be greatly appreciated,
>
> > > > Thanks!
> > > > Keith
>
> > > > On Feb 8, 2:53 pm, Matt Foster <[EMAIL PROTECTED]> wrote:
>
> > > > > You can always go back to the basics and say
>
> > > > > element.style.left = "200px";
>
> > > > > Or you could just omit IE users, i think thats the better
> > > > > approach  ;-)
>
> > > > > On Feb 8, 11:47 am, Rauan Maemirov <[EMAIL PROTECTED]> wrote:
>
> > > > > > Yeah, that's would be right. But I'm adding new elements in js-
> > > > > > scripts. So, there's no difference.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to