[Prototype-core] Re: Element.build and element.build

2007-06-01 Thread Tobie Langel
Just to get things straight: var el = new Element('div', { style: 'border: 1px solid red; margin 1em;' }); Is perfectly feasable and will work. > var el = new Element('elem', attributes); > el.style.border = border; // and other css rules if needed > el.observe('click', action); >

[Prototype-core] Re: Element.build and element.build

2007-06-01 Thread Радослав Станков
My be such wrapper around "new Element()" will be useful, but Ask your self when you insert nodes where do you insert them, or how (with appendChild, insertBefore, insertAfter, ), an when inserting item do you just create it, or add events or do other things except that ? mainly I do some thin

[Prototype-core] Re: Element.build and element.build

2007-05-31 Thread timcharper
On May 30, 9:06 am, "Mislav Marohnić" <[EMAIL PROTECTED]> wrote: > On 5/30/07, timcharper <[EMAIL PROTECTED]> wrote: > > > > > What do you think if we added a shortcut method to > > an instantiated method capable of building and appending a new element > > to it in one swoop? > > So you're propo

[Prototype-core] Re: Element.build and element.build

2007-05-30 Thread Mislav Marohnić
On 5/30/07, timcharper <[EMAIL PROTECTED]> wrote: > > > What do you think if we added a shortcut method to > an instantiated method capable of building and appending a new element > to it in one swoop? So you're proposing a wrapper around "new Element(); appendChild()"? It's useful, yeah... But i

[Prototype-core] Re: Element.build and element.build

2007-05-30 Thread timcharper
> Радослав (Radoslav?) is right, we already have this: > > my_div = new Element("div"); > my_div.insert(new Element("h1").update("Hello there!")); > my_div.insert(new Element("p").update("Hello, here is some > text").setStyle({fontSize: "25px" })); Wow! Looks like I'm just barely too late to su

[Prototype-core] Re: Element.build and element.build

2007-05-30 Thread Mislav Marohnić
On 5/29/07, timcharper <[EMAIL PROTECTED]> wrote: > > > my_div = Element.build("div"); > my_div.build("h1", { innerHTML: "Hello there!" } ); > my_div.build("p", { innerHTML: "Hello, here is some text" }, > { fontSize: "25px"}); Радослав (Radoslav?) is right, we already have this: my_div = new El

[Prototype-core] Re: Element.build and element.build

2007-05-30 Thread Радослав Станков
this sounds like: $('some_element_id').appendChild( new Element(tagName, options) ); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Prototype: Core" group. To post to this group, send email to prototype-core@goo