<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ajax Bestiary &#187; mootools</title>
	<atom:link href="http://www.ajaxbestiary.com/category/mootools/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ajaxbestiary.com</link>
	<description>AJAX Development, News, Techniques &#38; More</description>
	<lastBuildDate>Wed, 01 Feb 2012 12:46:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why you should care about MooTools</title>
		<link>http://www.ajaxbestiary.com/2011/06/09/why-you-should-care-about-mootools/</link>
		<comments>http://www.ajaxbestiary.com/2011/06/09/why-you-should-care-about-mootools/#comments</comments>
		<pubDate>Fri, 10 Jun 2011 01:26:19 +0000</pubDate>
		<dc:creator>Dave Mahon</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[Javascript Frameworks]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[js framework]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/?p=422</guid>
		<description><![CDATA[Let me start by saying that I love jQuery. Most of the time, it makes it very easy to write sane code. Sometimes, however, it just feels weird. For example, let&#8217;s say we need to insert a link at the beginning of a div. You might write something like: $&#40;'#myDiv'&#41;.prepend&#40;'&#60;a href=&#34;http://my.host/path&#34; title=&#34;This is a cool [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Let me start by saying that I love jQuery. Most of the time, it makes it very easy to write sane code. Sometimes, however, it just feels weird.</p>
<p>For example, let&#8217;s say we need to insert a link at the beginning of a div. You might write something like:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#myDiv'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">prepend</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a href=&quot;http://my.host/path&quot; title=&quot;This is a cool link!&quot;&gt;Click here&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>-or-</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'&lt;a href=&quot;http://my.host/path&quot; title=&quot;This is a cool link!&quot;&gt;Click here&lt;/a&gt;'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">prependTo</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#myDiv'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>It seems fairly straightforward, but it&#8217;s a maintenance nightmare, because you now have raw HTML buried inside of your Javascript. If it&#8217;s complicated HTML that is being dynamically constructed, it&#8217;s all too easy to introduce hard to find browser parser errors.</p>
<p><a href="http://mootools.net/">MooTools</a>, on the other hand, gives you a powerful alternative with its Element class.</p>
<p>To create a new DOM element you literally call a constructor and pass the tag name and attributes to it. So, for example, that same link would be built with:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myLink <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Element<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span>
 href<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;http://my.host/path&quot;</span><span style="color: #339933;">,</span>
 title<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;This is a cool link!&quot;</span><span style="color: #339933;">,</span>
 text<span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;Click here&quot;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>At the price of a handful of few extra bytes, you get clear, legible code. The equivalent of .prepend() is thus:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#myDiv'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">grab</span><span style="color: #009900;">&#40;</span>myLink<span style="color: #339933;">,</span> <span style="color: #3366CC;">'top'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>While this might at first seem less intuitive, you can use the same method call to insert that link before or after the selected element. Sure, you could do that with .before() or .after() in jQuery, but imagine if you needed to make the insertion point variable!</p>
<p>There are also a slew of additional benefits, like ECMAScript 5 array methods, support for <a href="http://www.anup.info/2010/07/12/mootools-class-methods-and-inheritance/">multiple inheritance</a>, and event handlers that make it easy to detect if the user is pressing Alt while right clicking.</p>
<p>Give MooTools a try, but before you do, I strongly urge you to read Sean McArthur&#8217;s excellent post, <a href="http://mootools.net/blog/2010/03/19/a-better-way-to-use-elements/">A Better Way to use Elements</a>, on the difference between $() and $$(). If you come from a background of using Prototype, it will seem perfectly natural, but jQuery users can be caught by surprise.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2011/06/09/why-you-should-care-about-mootools/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Mootools 1.2 Beta has landed</title>
		<link>http://www.ajaxbestiary.com/2007/11/14/mootools-12-beta-has-landed/</link>
		<comments>http://www.ajaxbestiary.com/2007/11/14/mootools-12-beta-has-landed/#comments</comments>
		<pubDate>Wed, 14 Nov 2007 14:08:50 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[mootools]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/11/14/mootools-12-beta-has-landed/</guid>
		<description><![CDATA[Mootoos 1.2 Beta has landed and if you plan on using it soon, you need to get cracking porting &#38; learning the new API. Some of the changes: Test Suite Integration Fx.Tween &#38; Fx.Morph to Fx.Style Hashables Sortables (brand&#160; new version) Number Math integration Improved object inheritance with Extend &#38; Implement Read all about it [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Mootoos 1.2 Beta has landed and if you plan on using it soon, you need to get cracking porting &amp; learning the new API.</p>
<p>Some of the changes:
<ul>
<li>Test Suite Integration</li>
<li>Fx.Tween &amp; Fx.Morph to Fx.Style</li>
<li>Hashables</li>
<li>Sortables (brand&nbsp; new version)</li>
<li>Number Math integration</li>
<li>Improved object inheritance with Extend &amp; Implement</li>
</ul>
<p>Read all about it here:<br /><a href="http://blog.mootools.net/2007/11/14/mootools-1-2-beta-1">http://blog.mootools.net/2007/11/14/mootools-1-2-beta-1</a></p>
<p>via <a href="http://clientside.cnet.com/industry-news/mootools-12-beta-woot/">Clientside</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/11/14/mootools-12-beta-has-landed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handling Space in Mootools</title>
		<link>http://www.ajaxbestiary.com/2007/11/02/handling-space-in-mootools/</link>
		<comments>http://www.ajaxbestiary.com/2007/11/02/handling-space-in-mootools/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 16:48:12 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[Article]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[dimensions]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/11/02/handling-space-in-mootools/</guid>
		<description><![CDATA[Today we continue our series exploring the way spacial data is handled in Javascript toolkits with a look at mootools.  (Read Previous Installments on jQuery and prototype).   Similar to prototype, mootools includes dimensioning information in the Element Object.  Unlike prototype, mootools includes positioning information there as well.  Window &#38; Document level information is contained separately [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>Today we continue our series exploring the way spacial data is handled in Javascript toolkits with a look at mootools.  (Read Previous Installments on <a href="http://www.ajaxbestiary.com/2007/10/31/jquery-dimension-plugin-spacial-awareness-made-simple/">jQuery</a> and <a href="http://www.ajaxbestiary.com/2007/11/01/handling-dimensions-with-prototype/">prototype</a>).   Similar to prototype, mootools includes dimensioning information in the Element Object.  Unlike prototype, mootools includes positioning information there as well.  Window &amp; Document level information is contained separately in Window.size.js</p>
<p>Element Dimension &amp; Position Properties (Element.Dimensions.js):</p>
<ul>
<li> scrollTo(): Scrolls an element to a specified position (in some toolkits, scroll to scrolls the container to the specified element).</li>
<li>getSize(): Returns an Object representing all size &amp; scroll values of the elemen.</li>
<li>getPosition(): Returns the real offsets of the element (relative to document).</li>
<li>getTop: Returns the top position of the element (relative to the window).</li>
<li>getLeft: Returns the left position of the element (relative to the window).</li>
</ul>
<p>The Window dimensions (Window.Size.js):</p>
<ul>
<li>getWidth: Returns width <strong>Window</strong></li>
<li>getScrollWidth: Returns width of<strong> Document</strong></li>
<li>getHeight: Returns height of <strong>Window</strong></li>
<li>getScrollHeight: Returns height of <strong> Document</strong></li>
<li>getScrollLeft: Determine current left offset of viewport relative to document.</li>
<li>getScrollTop: Determine current vertical offset of viewport relative to document.</li>
<li>getSize: Same as Element.getSize.</li>
</ul>
<p>Next time, we&#8217;ll look at YUI.</p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/11/02/handling-space-in-mootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mootabs, Simple Easy Tabs For Mootools</title>
		<link>http://www.ajaxbestiary.com/2007/10/31/mootabs-simple-easy-tabs-for-mootools/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/31/mootabs-simple-easy-tabs-for-mootools/#comments</comments>
		<pubDate>Wed, 31 Oct 2007 12:18:02 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[mootools]]></category>
		<category><![CDATA[Widget]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[tabs]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/31/mootabs-simple-easy-tabs-for-mootools/</guid>
		<description><![CDATA[If you&#8217;re looking for a fast and easy way to add tabs to your next project.&#160; It doesn&#8217;t get simpler than Mootabs: a lightweight tab widget in mootools. Key Features: Able to retrieve tab contents via AJAX CSS Styling Transition effects Simplified Markup I&#8217;ve noticed the transitions can be a bit coarse and distracting so [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p><a href="http://www.ajaxbestiary.com/wp-content/uploads/2007/10/mootabs.jpg"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="119" alt="mootabs" src="http://www.ajaxbestiary.com/wp-content/uploads/2007/10/mootabs-thumb.jpg" width="518" border="0"></a>
<p>If you&#8217;re looking for a fast and easy way to add tabs to your next project.&nbsp; It doesn&#8217;t get simpler than Mootabs: a lightweight tab widget in mootools.</p>
<p><font color="#333333"><strong>Key Features:</strong></font></p>
<ul>
<li><font color="#333333">Able to retrieve tab contents via AJAX</font></li>
<li><font color="#333333">CSS Styling</font></li>
<li><font color="#333333">Transition effects</font></li>
<li><font color="#333333">Simplified Markup</font></li>
</ul>
<p><font color="#333333">I&#8217;ve noticed the transitions can be a bit coarse and distracting so I recomend using mootabs without strong transitions if possible.</font></p>
<p>Get Mootabs Here: <a title="http://www.silverscripting.com/mootabs/" href="http://www.silverscripting.com/mootabs/">http://www.silverscripting.com/mootabs/</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/31/mootabs-simple-easy-tabs-for-mootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hashes in Mootools 1.2</title>
		<link>http://www.ajaxbestiary.com/2007/10/30/hashes-in-mootools-12/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/30/hashes-in-mootools-12/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 20:41:06 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[mootools]]></category>
		<category><![CDATA[]]></category>
		<category><![CDATA[Hash]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/30/hashes-in-mootools-12/</guid>
		<description><![CDATA[As of 1.2, the Mootools Hash plugin has been promoted to a Native type.&#160; Basically, a Hash is a wrapper for native Javascript objects (keeping things OO all the way &#38; preventing attacks on the Object Prototype).&#160; What it does: Provides a wrapper for associative arrays. Works just like a traditional Mootools Array (Each is [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>As of 1.2, the Mootools Hash plugin has been promoted to a Native type.&nbsp; Basically, a Hash is a wrapper for native Javascript objects (keeping things OO all the way &amp; preventing attacks on the Object Prototype).&nbsp; </p>
<p>What it does: </p>
<ul>
<li>Provides a wrapper for associative arrays.</li>
<li>Works just like a traditional Mootools Array (Each is your friend)</li>
<li>Supports Generics.</li>
</ul>
<p><font color="#000000">Read more about Hashes in Mootools 1.2 here:</font></p>
<p><a title="http://blog.mootools.net/2007/10/8/what-s-new-in-1-2-the-hash" href="http://blog.mootools.net/2007/10/8/what-s-new-in-1-2-the-hash">http://blog.mootools.net/2007/10/8/what-s-new-in-1-2-the-hash</a>
<p><font color="#000000"></font></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/30/hashes-in-mootools-12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mootools 1.2: The Evolution of FX</title>
		<link>http://www.ajaxbestiary.com/2007/10/26/mootools-12-the-evolution-of-fx/</link>
		<comments>http://www.ajaxbestiary.com/2007/10/26/mootools-12-the-evolution-of-fx/#comments</comments>
		<pubDate>Fri, 26 Oct 2007 12:33:53 +0000</pubDate>
		<dc:creator>Don Albrecht</dc:creator>
				<category><![CDATA[mootools]]></category>

		<guid isPermaLink="false">http://www.ajaxbestiary.com/2007/10/26/mootools-12-the-evolution-of-fx/</guid>
		<description><![CDATA[For most developers, the most noticeable change with Mootools 1.2 is the deprecation of the incredible FX.style &#38; FX.styles libraries in favor of the new Fx.Tween &#38; Fx.Morph.&#xA0; So what&#8217;s the difference?&#xA0; It&#8217;s really a name change to more accurately describe the behavior and use of the two different tools. What&#8217;s pretty incredible though, is [...]]]></description>
			<content:encoded><![CDATA[
<!-- google_ad_section_start -->
<p>For most developers, the most noticeable change with Mootools 1.2 is the deprecation of the incredible FX.style &amp; FX.styles libraries in favor of the new Fx.Tween &amp; Fx.Morph.&#xA0; So what&#8217;s the difference?&#xA0; It&#8217;s really a name change to more accurately describe the behavior and use of the two different tools.</p>
<p>What&#8217;s pretty incredible though, is how powerful the revamped Fx.Morph has become.&#xA0; You can now smoothly transition from any given class in your CSS stylesheet smoothly.&#xA0; This fully separates the behavior (e.g. A smooth transition to an error state) from the CSS defined appearance of that Error state.&#xA0; </p>
<p>If the property cannot be calculated, it will be set at the start of the transition.</p>
<p>Lastly, the &quot;wait&quot; option has been replaced with a new &quot;chain&quot; option.&#xA0; This allows&#xA0; you to simply append effects at the end of the sequence currently being executed.</p>
<p>Read More on the Mootools Blog</p>
<p><a title="http://blog.mootools.net/2007/10/23/The_Best_Javascript_Effects_Now_Even_Better" href="http://blog.mootools.net/2007/10/23/The_Best_Javascript_Effects_Now_Even_Better">http://blog.mootools.net/2007/10/23/The_Best_Javascript_Effects_Now_Even_Better</a></p>
<p><img src="http://www.ajaxbestiary.com/?voyeur=1"></p>
<!-- google_ad_section_end -->
]]></content:encoded>
			<wfw:commentRss>http://www.ajaxbestiary.com/2007/10/26/mootools-12-the-evolution-of-fx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

