<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Create Custom Element Property Getters and Setters with&#160;MooTools</title> <atom:link href="http://davidwalsh.name/mootools-custom-element/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/mootools-custom-element</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Wed, 23 May 2012 14:01:31 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Dan Parnham</title><link>http://davidwalsh.name/mootools-custom-element#comment-22848</link> <dc:creator>Dan Parnham</dc:creator> <pubDate>Thu, 24 Feb 2011 15:07:22 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4961#comment-22848</guid> <description>I know this article was from a while ago, but I&#039;ve just discovered it and it is relevant to something I have been attempting recently.You asked if there are any other items we would like in the properties set and my suggestion is this:&lt;code&gt;
Element.Properties.children = {
get: function() {
return this.getChildren();
},
set: function(value) {
this.adopt(value);
}
};
&lt;/code&gt;which would then allow you to instantiate more complex Element hierarchies as follows:&lt;code&gt;
new Element(&#039;div.background&#039;, { children: [
new Element(&#039;div.container&#039;, { children: [
new Element(&#039;div.window&#039;, { children: [
new Element(&#039;h1&#039;, { text: &#039;A title&#039; }),
new Element(&#039;div.content&#039;),
new Element(&#039;div.bar&#039;, { children: [
new Element(&#039;button&#039;, { text: &#039;OK&#039;, events: { ... }}),
new Element(&#039;button&#039;, { text: &#039;Cancel&#039;, events: { ... }})
]})
]})
]})
]});
&lt;/code&gt;With this you can easily see (and modify) the hierarchy instead of having to follow through all of the inject/adopt/grab calls.Regards,
Dan</description> <content:encoded><![CDATA[<p>I know this article was from a while ago, but I&#8217;ve just discovered it and it is relevant to something I have been attempting recently.</p><p>You asked if there are any other items we would like in the properties set and my suggestion is this:</p><p><code><br
/> Element.Properties.children = {<br
/> get: function() {<br
/> return this.getChildren();<br
/> },<br
/> set: function(value) {<br
/> this.adopt(value);<br
/> }<br
/> };<br
/> </code></p><p>which would then allow you to instantiate more complex Element hierarchies as follows:</p><p><code><br
/> new Element('div.background', { children: [<br
/> new Element('div.container', { children: [<br
/> new Element('div.window', { children: [<br
/> new Element('h1', { text: 'A title' }),<br
/> new Element('div.content'),<br
/> new Element('div.bar', { children: [<br
/> new Element('button', { text: 'OK', events: { ... }}),<br
/> new Element('button', { text: 'Cancel', events: { ... }})<br
/> ]})<br
/> ]})<br
/> ]})<br
/> ]});<br
/> </code></p><p>With this you can easily see (and modify) the hierarchy instead of having to follow through all of the inject/adopt/grab calls.</p><p>Regards,<br
/> Dan</p> ]]></content:encoded> </item> <item><title>By: David Walsh</title><link>http://davidwalsh.name/mootools-custom-element#comment-17504</link> <dc:creator>David Walsh</dc:creator> <pubDate>Mon, 10 May 2010 16:42:06 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4961#comment-17504</guid> <description>@Bill:  Like this:&lt;code&gt;
var parent = document.id(&#039;myElement&#039;).get(&#039;parent&#039;).get(&#039;id&#039;);
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>@Bill:  Like this:</p><p><code><br
/> var parent = document.id('myElement').get('parent').get('id');<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: Bill</title><link>http://davidwalsh.name/mootools-custom-element#comment-17503</link> <dc:creator>Bill</dc:creator> <pubDate>Mon, 10 May 2010 16:33:07 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4961#comment-17503</guid> <description>How do I get just the parent id, not the parent?</description> <content:encoded><![CDATA[<p>How do I get just the parent id, not the parent?</p> ]]></content:encoded> </item> <item><title>By: Arian</title><link>http://davidwalsh.name/mootools-custom-element#comment-17396</link> <dc:creator>Arian</dc:creator> <pubDate>Mon, 03 May 2010 21:11:41 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4961#comment-17396</guid> <description>@Marcel:  You can do that with Element.Styles: http://github.com/mootools/mootools-core/blob/master/Source/Element/Element.Style.js#L137Something like this:
http://jsfiddle.net/8Ks4X/1/</description> <content:encoded><![CDATA[<p>@Marcel:  You can do that with Element.Styles: <a
href="http://github.com/mootools/mootools-core/blob/master/Source/Element/Element.Style.js#L137" rel="nofollow">http://github.com/mootools/mootools-core/blob/master/Source/Element/Element.Style.js#L137</a></p><p>Something like this:<br
/> <a
href="http://jsfiddle.net/8Ks4X/1/" rel="nofollow">http://jsfiddle.net/8Ks4X/1/</a></p> ]]></content:encoded> </item> <item><title>By: Marcel</title><link>http://davidwalsh.name/mootools-custom-element#comment-17394</link> <dc:creator>Marcel</dc:creator> <pubDate>Mon, 03 May 2010 18:48:31 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4961#comment-17394</guid> <description>I was asking yesterday on the mootools irc channel if there is a way to add a property to css properties so I can do something similar, tweening -webkit-box-shadow and -moz-box-shadow, only using one property, like this:el.tween(&#039;box-shadow&#039;, xxx);Do you know if this is possible?</description> <content:encoded><![CDATA[<p>I was asking yesterday on the mootools irc channel if there is a way to add a property to css properties so I can do something similar, tweening -webkit-box-shadow and -moz-box-shadow, only using one property, like this:</p><p>el.tween(&#8216;box-shadow&#8217;, xxx);</p><p>Do you know if this is possible?</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 3/7 queries in 0.006 seconds using disk: basic
Object Caching 507/507 objects using disk: basic

Served from: davidwalsh.name @ 2012-05-23 09:03:40 -->
