<?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>Garrick Cheung</title>
	<atom:link href="http://www.garrickcheung.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.garrickcheung.com</link>
	<description>Sharing what I know and learn about CSS, MooTools, Javascript, PHP and etc.</description>
	<lastBuildDate>Fri, 30 Sep 2011 05:16:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>MooTools Core 1.3.2 and More 1.3.2.1</title>
		<link>http://www.garrickcheung.com/javascript/mootools-core-1-3-2-and-more-1-3-2-1/</link>
		<comments>http://www.garrickcheung.com/javascript/mootools-core-1-3-2-and-more-1-3-2-1/#comments</comments>
		<pubDate>Fri, 29 Apr 2011 17:24:06 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=381</guid>
		<description><![CDATA[MooTools just released an update to their Core and More libs. They are mostly fixes but More also comes with a brand new and shiny new Utility class called Tables! Changes (and I quote!) to Core Fixed Slick bug with ~div-like selectors Fixed MooTools in the Node.js environment Fixed an exception in DOMReady in Chrome [...]]]></description>
			<content:encoded><![CDATA[<p>MooTools just released an <a href="http://mootools.net/blog/2011/04/28/mootools-core-1-3-2-and-more-1-3-2-1/">update to their Core and More libs</a>. They are mostly fixes but More also comes with a brand new and shiny new <a href="http://mootools.net/docs/more/Utilities/Table">Utility class called Tables</a>!</p>
<p><strong>Changes (and I quote!) to Core</strong></p>
<ul>
<li>Fixed Slick bug with ~div-like selectors</li>
<li>Fixed MooTools in the Node.js environment</li>
<li>Fixed an exception in DOMReady in Chrome when the page with MooTools was in an IFrame</li>
<li>Fixed setOpacity for very small numbers in IE</li>
<li>Fixed an exception in FireFox 4 when MooTools tried to overwrite document.head</li>
<li>Added the possibility to create elements with boolean values with an selector, e.g. new Element(&#8216;input[checked]&#8216;);</li>
</ul>
<p><strong>Changes to More (that I also quote):</strong></p>
<ul>
<li>Rewritten Element.Position which solved some issues</li>
<li>Added Table, as described above</li>
<li>Ironed out some Event Delegation issues</li>
<li>Additional fixes can be found at the <a href="https://mootools.lighthouseapp.com/projects/24057/milestones/104271-1322" rel="nofollow">Lighthouse for 1.3.2.1</a></li>
</ul>
<p>Yay, MooTools developers! You guys are seriously stepping up with a quicker release. In the words of my friend <a href="http://davidwalsh.name/">David Walsh</a>: MooTools FTW!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/javascript/mootools-core-1-3-2-and-more-1-3-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MooTools Core 1.3.1 and More 1.3.1.1</title>
		<link>http://www.garrickcheung.com/mootools/mootools-core-1-3-1-and-more-1-3-1-1/</link>
		<comments>http://www.garrickcheung.com/mootools/mootools-core-1-3-1-and-more-1-3-1-1/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 07:03:25 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=373</guid>
		<description><![CDATA[A post long overdue.. but that&#8217;s besides the point. The MooTools Dev team released MooTools Core 1.3.1 and More 1.3.1.1! Changes (and I quote!) Lots (and by that I mean LOTS) of documentation improvements, clarifications and cleanups Updated Slick to 1.1.5 and improved the speed of our Slick selector engine Added delegation support for submit, [...]]]></description>
			<content:encoded><![CDATA[<p>A post long overdue.. but that&#8217;s besides the point. The MooTools Dev team <a href="http://mootools.net/blog/2011/02/25/mootools-core-more-1-3-1/">released MooTools Core 1.3.1 and More 1.3.1.1</a>!</p>
<p><strong>Changes (and I quote!)</strong></p>
<ul>
<li>Lots (and by that I mean LOTS) of documentation improvements, clarifications and cleanups</li>
<li>Updated Slick to 1.1.5 and improved the speed of our Slick selector engine</li>
<li>Added delegation support for submit, focus, blur, reset, change and select events in MooTools More</li>
<li>If available the native JSON methods are now used in JSON.decode and JSON.encode</li>
<li>Multiple Pseudos click:relay(a):once (demo)</li>
<li>Two new pseudo events: :throttle and :pause</li>
<li>Added String.truncate to String.Extras in More</li>
<li>More than two hundred changes to increase the stability of both Core &#038; More</li>
</ul>
<p>MooTools Dev, you&#8217;ve been quite awesome. Keep up the great work!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/mootools/mootools-core-1-3-1-and-more-1-3-1-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MooTools 1.3 Beta!!</title>
		<link>http://www.garrickcheung.com/uncategorized/mootools-1-3-beta/</link>
		<comments>http://www.garrickcheung.com/uncategorized/mootools-1-3-beta/#comments</comments>
		<pubDate>Wed, 28 Apr 2010 02:52:47 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=369</guid>
		<description><![CDATA[MooTools 1.3 Beta was just released. You can check out the blog entry for all the details. I&#8217;ll let you in on one thing that&#8217;s in it. Slick. Oh yeah, I&#8217;m still alive, if you were wondering..]]></description>
			<content:encoded><![CDATA[<p><a href="http://mootools.net/blog/2010/04/27/mootools-1-3-beta-1/">MooTools 1.3 Beta</a> was just released. You can check out the blog entry for all the details. I&#8217;ll let you in on one thing that&#8217;s in it. Slick.</p>
<p>Oh yeah, I&#8217;m still alive, if you were wondering.. <img src='http://www.garrickcheung.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/uncategorized/mootools-1-3-beta/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building on David Walshes MooTools Tip: Event.stop</title>
		<link>http://www.garrickcheung.com/mootools/mootools-tip-event-stop/</link>
		<comments>http://www.garrickcheung.com/mootools/mootools-tip-event-stop/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 02:56:45 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=362</guid>
		<description><![CDATA[David Walsh shared a tip on how he handles firing events on an element without user input to trigger the event. I&#8217;m going to build on that by sharing how I would handle it. Problem The issue is that usually an event is added and the default behavior is disabled. 1 2 3 4 $&#40;'myLink'&#41;.addEvent&#40;'click',function&#40;e&#41; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://davidwalsh.name/mootools-event-stop">David Walsh shared a tip</a> on how he handles firing events on an element without user input to trigger the event. I&#8217;m going to build on that by sharing how I would handle it.<span id="more-362"></span></p>
<h3>Problem</h3>
<p>The issue is that usually an event is added and the default behavior is disabled.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myLink'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    e.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #006600; font-style: italic;">//do stuff</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And if you just so happen to need to trigger the event manually, like so:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myLink'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fireEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>You&#8217;ll get an error that the stop method doesn&#8217;t exist. This is because you&#8217;re just firing the function and an event argument is not being passed into the function.</p>
<p>Now, lets say you have a class and you wanted to manually execute a method that&#8217;s being attached to an event. An error would also occur in this case.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myClass <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> <span style="color: #003366; font-weight: bold;">Class</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #006600; font-style: italic;">// ... some code here..</span>
&nbsp;
    <span style="color: #006600; font-style: italic;">// the click event function that is attached..</span>
    clicky<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        e.<span style="color: #000066;">stop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #006600; font-style: italic;">//.. do some clicky stuff</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// create instance of class</span>
<span style="color: #003366; font-weight: bold;">var</span> instance_of_myClass <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> myClass<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// firing clicky function</span>
instance_of_myClass.<span style="color: #660066;">clicky</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// results in error because stop() does not exist</span></pre></td></tr></table></div>

<h3>Solution</h3>
<p>Here&#8217;s how you can solve both problems, and I learned this from <a href="http://keetology.com/">Mark Obcena</a>. This is very useful if you don&#8217;t want to modify the classes code or extend it. Pass in a dummy object with an empty stop function:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// this will fire the click event without an issue</span>
$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'myLink'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fireEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #000066;">stop</span><span style="color: #339933;">:</span>$empty<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// this too will fire the clicky function on the instance without an issue</span>
instance_of_myClass.<span style="color: #660066;">clicky</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><span style="color: #000066;">stop</span><span style="color: #339933;">:</span>$empty<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Tada! Thanks David and Mark!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/mootools/mootools-tip-event-stop/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Announcing: MooTools Forge!</title>
		<link>http://www.garrickcheung.com/mootools/announcing-mootools-forge/</link>
		<comments>http://www.garrickcheung.com/mootools/announcing-mootools-forge/#comments</comments>
		<pubDate>Thu, 10 Dec 2009 21:24:01 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=359</guid>
		<description><![CDATA[Exciting news! MooTools has just announced their plugin repository, MooTools Forge! It&#8217;s hooked into GitHub and it&#8217;s open sourced. How awesome! Check out all the details from the MooTools blog!]]></description>
			<content:encoded><![CDATA[<p>Exciting news! <a href="http://mootools.net">MooTools</a> has just announced their plugin repository, <a href="http://mootools.net/forge/">MooTools Forge</a>! It&#8217;s hooked into <a href="http://www.github.com">GitHub</a> and it&#8217;s open sourced. How awesome!</p>
<p>Check out all the details from the <a href="http://mootools.net/blog/2009/12/10/the-official-mootools-plugins-repository-is-here/">MooTools blog</a>!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/mootools/announcing-mootools-forge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Released: MooTools 1.2.3</title>
		<link>http://www.garrickcheung.com/mootools/released-mootools-123/</link>
		<comments>http://www.garrickcheung.com/mootools/released-mootools-123/#comments</comments>
		<pubDate>Fri, 19 Jun 2009 22:18:15 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=349</guid>
		<description><![CDATA[I&#8217;m excited to tell you that MooTools 1.2.3 has been released today! It&#8217;s mainly bug fixes and updates. One major change is compatibility with other frameworks. Like the MooTools-Dev team, I do not advise using more than one framework. But if you have to.. then you have to. See below for a list of changes, [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m excited to tell you that <a href="http://mootools.net/blog/2009/06/19/mootools-123-released/" target="_blank">MooTools 1.2.3</a> has been released today! It&#8217;s mainly bug fixes and updates. One major change is compatibility with other frameworks. Like the MooTools-Dev team, I do not advise using more than one framework. But if you have to.. then you have to. See below for a list of changes, straight from the cows mouth!<span id="more-349"></span></p>
<p><strong>Core</strong></p>
<ul>
<li>Element: MooTools compatibility mode: the $ function is only defined if no pre-existing $ function is found. If an existing $ function is found, you can use document.id()</li>
<li>Element: changed internal instances of $ to document.id</li>
<li>Core: fix for server-side MS JScript 5.x; makes MooTools more friendly for server side programming</li>
<li>Class: Class doesn’t require Browser, removed from scripts.json</li>
<li>Element: Fixes for set/get Property</li>
<li>Element.Dimensions: fix for webkit body.scrollTop inconsistency, getBoundingClientRect used whenever possible (not just for Trident), renaming element.position to element.setPosition; adding docs for the method; alias is included in-line for compatibility</li>
<li>Hash: Hash extend no longer uses the window if no arguments supplied</li>
<li>Request: clearing Request readystate before calling success or failure;</li>
<li>Selectors: Added :enabled pseudoselector, was in the Docs but not implemented.</li>
<li>Docs: Fixed docs headers for first-child, last-child, and only-child.</li>
<li>Internal: UnitTester test suite is now a git submodule</li>
<li>Numerous small fixes, speed improvements, documentation tweaks, etc.</li>
</ul>
<p><strong>More</strong></p>
<ul>
<li>Per the change in -core, $ is no longer used (uses document.id instead)</li>
<li>Element.Measure: trying cssText solution for Element.expose (again).</li>
<li>Element.Forms: swapping feature detection for browser support per</li>
<li>Date: Massive refactoring of Date.js and Date.Extras.js</li>
<li>Drag.Move: Fixing drag with grid issues</li>
<li>IframeShim: altering zindex assignment in IframeShim to better ensure that it’s always underneath the shimmed element, updating Iframeshim’s empty document creation; fixes https issues in IE6</li>
<li>FormValidator: reworking formvalidator scroll-to logic to be a little more efficient</li>
<li>OverText: preventing overtext from focusing on inputs except when they are interacted with (so OverText.update() does not focus an input);now stops polling when elements are hidden (when polling is enabled)</li>
<li>Fx.Scroll: adding scrollIntoView method &#8211; scrolls an element so that it is completely visible; if below the view, scrolls down until it is at the bottom of the screen, if above, scrolls up until it is at the top.</li>
<li>JSONP: was calling (the deprecated) this.request instead of this.send during retries</li>
<li>URI: Adding set(‘data’, obj) to set</li>
<li>Assets: adding error callback for Assets.images</li>
<li>Tips: removing dependency for Element.Measure for Tips; updating CSS class name in OverText</li>
<li>Numerous small fixes, speed improvements, documentation tweaks, etc.</li>
</ul>
<p>Great job MooTools-Dev team!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/mootools/released-mootools-123/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search Stylesheet Selectors with MooTools</title>
		<link>http://www.garrickcheung.com/css/search-stylesheet-selectors-with-mootools/</link>
		<comments>http://www.garrickcheung.com/css/search-stylesheet-selectors-with-mootools/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 22:30:52 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[MooTools]]></category>
		<category><![CDATA[selector]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=340</guid>
		<description><![CDATA[You should already know that MooTools has Fx.Morph, that allows you to animate multiple css properties on an element and you can also pass it a selector string so you don&#8217;t have to type out all of the properties. Well, you can also pull these properties by using an undocumented method in MooTools, as I [...]]]></description>
			<content:encoded><![CDATA[<p>You should already know that MooTools has Fx.Morph, that allows you to animate multiple css properties on an element and you can also pass it a selector string so you don&#8217;t have to type out all of the properties.</p>
<p>Well, you can also pull these properties by using an undocumented method in MooTools, as I just learned from <a href="http://keetology.com/" target="_blank">Mark Obcena</a>. How? It&#8217;s very simple as you will see.<span id="more-340"></span></p>
<h3>Code</h3>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> selector_rules <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Fx.<span style="color: #660066;">CSS</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">search</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'.some_class'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// returns an object with camelCase key's</span></pre></td></tr></table></div>

<p>See, isn&#8217;t that simple? Keep in mind that this doesn&#8217;t give you every single property. In my tests of running this code with Firebug on <a href="http://www.gamespot.com" target="_blank">GameSpot.com</a>, font-family and overflow properties were missing in the returned object when it clearly shows up in Firebug&#8217;s CSS panel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/css/search-stylesheet-selectors-with-mootools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MooTools TextOverlay Class</title>
		<link>http://www.garrickcheung.com/mootools/textoverlay-class/</link>
		<comments>http://www.garrickcheung.com/mootools/textoverlay-class/#comments</comments>
		<pubDate>Tue, 19 May 2009 06:55:50 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[MoreSimple]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=328</guid>
		<description><![CDATA[Some classes I&#8217;ve come across do a lot and are inflexible. I&#8217;ve seen some that are semantically incorrect when it comes to creating/using elements that the user has no control over. So I&#8217;ve been mulling over the idea of rewriting/cleaning/correcting some of these classes that I come across in hopes to make them flexible and [...]]]></description>
			<content:encoded><![CDATA[<p>Some classes I&#8217;ve come across do a lot and are inflexible. I&#8217;ve seen some that are semantically incorrect when it comes to creating/using elements that the user has no control over. So I&#8217;ve been mulling over the idea of rewriting/cleaning/correcting some of these classes that I come across in hopes to make them flexible and simple. Well, I decided to have a go at it, obviously</p>
<p>I understand it&#8217;s like re-inventing the wheel. But in order to improve, we should always scrutinize work because a better solution may be available.</p>
<p>Here&#8217;s my first attempt, with the MooTools class, TextOverlay. If you look closely, it&#8217;s MooTools-More OverText modified to give the user more options.<span id="more-328"></span></p>
<h3>What&#8217;s the Difference?</h3>
<p>You must be wondering what&#8217;s different between the two. Well, I felt that positioning of the element should be handled by css, so I removed the reposition method. In OverText, the text-overlaying was created for you with MooTools and the default element was a &#8216;div&#8217; with &#8216;label&#8217; as your option.  I did away with that and you now can either pass in an existing DOM element, or create one on the fly (though you&#8217;ll need to inject it into the DOM yourself). OverText &#8216;show&#8217; and &#8216;hide&#8217; methods explicitly call&#8217;s the text-overlay&#8217;s show/hide methods and then fires custom events &#8216;textShow&#8217; and &#8216;textHide&#8217;. I decided to give the user flexibility by removing the explicit call&#8217;s to the text-overlay&#8217;s and only firing the custom events.</p>
<h3>Example</h3>
<p>The HTML, CSS, and JavaScript below is an example of how to set things up.</p>
<p><strong>HTML</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;div class=&quot;container&quot;&gt;
    &lt;form id=&quot;textoverlay_test&quot; name=&quot;textoverlay_test&quot; action=&quot;&quot; method=&quot;post&quot;&gt;
        &lt;fieldset&gt;
            &lt;legend&gt;&lt;/legend&gt;
            &lt;div class=&quot;fields&quot;&gt;
                &lt;input id=&quot;first_name&quot; type=&quot;text&quot; name=&quot;first_name&quot; value=&quot;&quot; /&gt;
                &lt;label for=&quot;first_name&quot;&gt;First Name&lt;/label&gt;
            &lt;/div&gt;
            &lt;div class=&quot;fields&quot;&gt;
                &lt;input type=&quot;text&quot; name=&quot;last_name&quot; value=&quot;&quot; /&gt;
                &lt;label for=&quot;last_name&quot;&gt;Last Name&lt;/label&gt;
            &lt;/div&gt;
        &lt;/fieldset&gt;
    &lt;/form&gt;
&lt;/div&gt;</pre></td></tr></table></div>

<p><strong>CSS</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
</pre></td><td class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.container</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
input<span style="color: #00AA00;">,</span> label <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">font</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span> arial<span style="color: #00AA00;">,</span> veranda<span style="color: #00AA00;">,</span> helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">16px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
label <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">-16px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.fields</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#333</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span><span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p><strong>JavaScript</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="javascript" style="font-family:monospace;">window.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'domready'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #003366; font-weight: bold;">var</span> input<span style="color: #339933;">,</span> label<span style="color: #339933;">,</span> fields <span style="color: #339933;">=</span> $$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#textoverlay_test .fields'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #003366; font-weight: bold;">new</span> TextOverlay<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">getElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'label'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><span style="color: #009900;">&#123;</span>
            onTextHide<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> text<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                text.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'none'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'hide'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//added to differentiate from default textHide event</span>
            <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
            onTextShow<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>element<span style="color: #339933;">,</span> text<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                text.<span style="color: #660066;">setStyle</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'display'</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'block'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'show'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">//added to differentiate from default textShow event</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Doing all this should simplify things and decrease the number of function calls. If you did a &#8216;console.profile&#8217; in Firebug, I&#8217;m sure you&#8217;ll notice the difference between OverText and TextOverlay. Give it a try and let me know what you think! I&#8217;ve set it up in <a href="http://github.com/GCheung55/MoreSimple/" target="_blank">Github</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/mootools/textoverlay-class/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MooTools FileManager by Christoph Pojer</title>
		<link>http://www.garrickcheung.com/uncategorized/mootools-filemanager-by-christoph-pojer/</link>
		<comments>http://www.garrickcheung.com/uncategorized/mootools-filemanager-by-christoph-pojer/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 21:23:29 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[file manager]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=322</guid>
		<description><![CDATA[Christoph, one of MooTools&#8217; developers and creator of Styx, a PHP framework, created a MooTools based File Manager. I&#8217;ve tried out his demos, and everything seems VERY slick. It has loads of features too. Features (straight from the horses mouth) Browse through Files and Folders on your Server Rename, Delete, Move (Drag&#38;Drop), Copy (Drag + [...]]]></description>
			<content:encoded><![CDATA[<p>Christoph, one of MooTools&#8217; developers and creator of <a href="http://styx.og5.net/" target="_blank">Styx, a PHP framework</a>, <a href="http://og5.net/christoph/article/MooTools_based_FileManager" target="_blank">created a MooTools based File Manager</a>. I&#8217;ve tried out his demos, and everything seems VERY slick. It has loads of features too.<span id="more-322"></span></p>
<p><strong>Features</strong> (straight from the horses mouth)</p>
<ul>
<li>Browse through Files and Folders on your Server</li>
<li>Rename, Delete, Move (Drag&amp;Drop), Copy (Drag + hold CTRL) and Download Files</li>
<li>View detailed Previews of Images, Text-Files, Compressed-Files or Audio Content</li>
<li>Nice User Interface <img src='http://www.garrickcheung.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </li>
<li>Upload Files via FancyUpload (integrated Feature)</li>
<li>Option to automatically resize big Images when uploading</li>
<li>Use it to select a File anywhere you need to specify one inside your Application&#8217;s Backend</li>
<li>Use as a FileManager in TinyMCE</li>
<li>Provides your Client with the most possible convenience ( ;D )</li>
</ul>
<p>The back-end is in PHP but you can port it to whatever language you&#8217;re working with. The file manager is also released under the MIT-License. This is currently his RC1 (1st release candidate, for those not in the know). <a href="http://og5.net/christoph/article/MooTools_based_FileManager" target="_blank">Head over to check out his demos</a>!</p>
<p>Great job, Christoph!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/uncategorized/mootools-filemanager-by-christoph-pojer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MooTools 1.2.2 and More Released!</title>
		<link>http://www.garrickcheung.com/mootools/mootools-122-and-more-released/</link>
		<comments>http://www.garrickcheung.com/mootools/mootools-122-and-more-released/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 01:31:19 +0000</pubDate>
		<dc:creator>Garrick</dc:creator>
				<category><![CDATA[MooTools]]></category>

		<guid isPermaLink="false">http://www.garrickcheung.com/?p=318</guid>
		<description><![CDATA[Valerio Proietti just posted the release of MooTools 1.2.2 and MooTools More (1.2.2.1). Looks like there are some goodies from the Core: MooTools 1.2.2 is a mainly a bug fix release but it also includes an almost entirely new Class.js. The reasoning behind this is that the old Class.js didn’t play nicely with some advanced [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mootools.net/blog/2009/04/23/mootools-122-and-the-new-mootools-more/" target="_blank"> Valerio Proietti just posted the release of MooTools 1.2.2 and MooTools More (1.2.2.1)</a>.</p>
<p>Looks like there are some goodies from the Core:</p>
<blockquote><p>
MooTools 1.2.2 is a mainly a bug fix release but it also includes an almost entirely new Class.js. The reasoning behind this is that the old Class.js didn’t play nicely with some advanced usages of this.parent() present in the new MooTools-More. We already had the script ready and tested in the MooTools 2.0 branch so we simply “backported” it to 1.2.2. Other than providing the parent fixes, the new Class also features a much more robust inheritance model, especially when dealing with objects.
</p></blockquote>
<p>And something for the More:</p>
<blockquote><p>One of the new features of MooTools-More, since the last RC, is that it is now possible access the previous state of overwritten methods of classes through Class.refractor.</p></blockquote>
<p>And last bit of exciting news: quick/regular new feature bi-weekly releases.</p>
<p>Way to go team! Thank you for the awesome work!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.garrickcheung.com/mootools/mootools-122-and-more-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

