<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en" xml:base="http://davidwalsh.name/wp-atom.php"><title type="text">David Walsh :: PHP, CSS, MooTools, jQuery, and Everything Else</title> <subtitle type="text">PHP, CSS, MooTools, jQuery, and Everything Else</subtitle><updated>2010-03-12T03:49:53Z</updated> <generator uri="http://wordpress.org/" version="2.9.2">WordPress</generator><link rel="alternate" type="text/html" href="http://davidwalsh.name" /> <id>http://davidwalsh.name/feed/atom</id><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Bludice" /><feedburner:info uri="bludice" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>43.072994</geo:lat><geo:long>-89.519924</geo:long><feedburner:emailServiceId>Bludice</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[Book Review: MooTools 1.2 Beginner’s&#160;Guide]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/p_Au0dxU23Q/mootools-book" /> <id>http://davidwalsh.name/?p=4931</id> <updated>2010-03-12T03:49:53Z</updated> <published>2010-03-12T03:49:53Z</published> <category scheme="http://davidwalsh.name" term="Books" /><category scheme="http://davidwalsh.name" term="MooTools" /> <summary type="html"><![CDATA[In the interest in full disclosure, I was sent this book by Packt Publishing in hopes that I would review it.  I’m reviewing this  book, however, in the interest of my audience.Unless you live under a rock or simply check my site for Christina Ricci pics every morning, you know I&#8217;m a bit [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/mootools-book">Book Review: MooTools 1.2 Beginner’s&nbsp;Guide</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/php5-cms-framework-development' rel='bookmark' title='Permanent Link: Book Review:  PHP5 CMS Framework&nbsp;Development'>Book Review:  PHP5 CMS Framework&nbsp;Development</a></li><li><a
href='http://davidwalsh.name/book-review-wicked-cool-php' rel='bookmark' title='Permanent Link: Book Review:  Wicked Cool&nbsp;PHP'>Book Review:  Wicked Cool&nbsp;PHP</a></li><li><a
href='http://davidwalsh.name/book-review-enterprise-ajax-strategies-building-high-performance-web-applications' rel='bookmark' title='Permanent Link: Book Review:  Enterprise Ajax &#8212; Strategies For Building High Performance Web&nbsp;Applications'>Book Review:  Enterprise Ajax &#8212; Strategies For Building High Performance Web&nbsp;Applications</a></li><li><a
href='http://davidwalsh.name/book-review-ajax-security-addison-wesley' rel='bookmark' title='Permanent Link: Book Review:  Ajax&nbsp;Security'>Book Review:  Ajax&nbsp;Security</a></li><li><a
href='http://davidwalsh.name/faces-of-moo' rel='bookmark' title='Permanent Link: Faces of Moo: Represent Your&nbsp;Framework!'>Faces of Moo: Represent Your&nbsp;Framework!</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/mootools-book">&lt;img
src="http://davidwalsh.name/dw-content/mootools-beginners.png" alt="MooTools Book" class="image" /&gt;&lt;p&gt;&lt;em&gt;In the interest in full disclosure, I was sent this book by Packt Publishing in hopes that I would review it.  I’m reviewing this  book, however, in the interest of my audience.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;Unless you live under a rock or simply check my site for Christina Ricci pics every morning, you know I&amp;#8217;m a bit of a MooTools fanboy.  I spend hours every day writing MooTools tutorials, getting in touch with the MooTools community and development team members, and oh yeah&amp;#8230;coding a bit too.  When it was brought to my attention that Jacob Gube and Garrick Cheung had written a MooTools book for beginners, I was really excited to check it out.  The following are my thoughts on their book.&lt;/p&gt;&lt;h2&gt;The Authors&lt;/h2&gt;&lt;p&gt;Jacob Gube, Garrick Cheung&lt;/p&gt;&lt;h2&gt;The Tagline&lt;/h2&gt;&lt;p&gt;Learn how to create dynamic, interactive, and responsive cross-browser web applications using this popular JavaScript framework.&lt;/p&gt;&lt;h2&gt;Shooting From the Hip&lt;/h2&gt;&lt;p&gt;Instead of giving you this super long review that you wont read, I&amp;#8217;ve decided to put my thoughts into bullet format.  How clever!&lt;/p&gt;&lt;ul&gt;&lt;li&gt;What I really love about this book is that it&amp;#8217;s not a bunch of &amp;#8220;theory&amp;#8221; information &amp;#8212; it&amp;#8217;s no-nonsense, code-based learning.  I LOVE these style of books.&lt;/li&gt;&lt;li&gt;The book is ~ 150 pages, which is about right for a beginner&amp;#8217;s guide.  Making it too long would be a huge mistake.&lt;/li&gt;&lt;li&gt;The price point is $40.  Reasonable.&lt;/li&gt;&lt;li&gt;The book covers a large array of sample projects and code examples &amp;#8212; you aren&amp;#8217;t looking at the same code snippets everywhere.  Awesome.&lt;/li&gt;&lt;li&gt;One gripe is that I don&amp;#8217;t recall the book ever discussing the difference between MooTools and similar libraries like jQuery, Dojo, etc.  MooTools&amp;#8217; object-oriented architecture and the idea of modifying native object prototypes is core to the framework and differentiates MooTools from other libraries.  That really should be included in a &amp;#8220;version 2&amp;#8243; book.&lt;/li&gt;&lt;li&gt;I was not included as a MooTools resource &amp;#8212; clearly an oversight.  Hahaha.&lt;/li&gt;&lt;li&gt;The book *does* cover creating a unique build of MooTools Core and -More.  This is very important as beginners should know that MooTools is built to be incredibly modular and Moo programmers should code with that same idea in mind.&lt;/li&gt;&lt;li&gt;The book flows very well and the progression of difficulty is perfect.  Beginners will really appreciate the pace of the book.&lt;/li&gt;&lt;li&gt;While Jacob isn&amp;#8217;t a member of the team, he co-authored with contributor Garrick Cheung and asked Christoph Pojer, a MooTools Core Developer, to be technical reviewer.  Involving people very close to the team was a great idea; it helps the book&amp;#8217;s credibility and allows for all options to be considered. &lt;em&gt;*  I don&amp;#8217;t mean to say this to discredit Jacob &amp;#8212; he&amp;#8217;s done a great job with this book and you certainly don&amp;#8217;t need to be a team member/contributor to be a MooTools expert.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;I know it&amp;#8217;s Packt&amp;#8217;s style, but the &amp;#8220;Impact&amp;#8221;-style heading fonts are ugly.&lt;/li&gt;&lt;li&gt;The book doesn&amp;#8217;t try to explain or gloss over basic javascript.  Thank you, thank you, thank you!&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;The Verdict&lt;/h2&gt;&lt;p&gt;I was very impressed with this book and I believe it&amp;#8217;s the perfect book for any developer looking to enter the MooTools pastures.  My only major desire is that the book cover MooTools&amp;#8217; native object prototype modification; beside that oversight, I&amp;#8217;d recommend this book to both rookie and novice MooTools developers.  MooTools 1.2 Beginner&amp;#8217;s Guide should be required reading for MooTools developers looking to master the basic of MooTools.&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/mootools-book"&gt;Book Review: MooTools 1.2 Beginner’s&amp;nbsp;Guide&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/php5-cms-framework-development' rel='bookmark' title='Permanent Link: Book Review:  PHP5 CMS Framework&amp;nbsp;Development'&gt;Book Review:  PHP5 CMS Framework&amp;nbsp;Development&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/book-review-wicked-cool-php' rel='bookmark' title='Permanent Link: Book Review:  Wicked Cool&amp;nbsp;PHP'&gt;Book Review:  Wicked Cool&amp;nbsp;PHP&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/book-review-enterprise-ajax-strategies-building-high-performance-web-applications' rel='bookmark' title='Permanent Link: Book Review:  Enterprise Ajax &amp;#8212; Strategies For Building High Performance Web&amp;nbsp;Applications'&gt;Book Review:  Enterprise Ajax &amp;#8212; Strategies For Building High Performance Web&amp;nbsp;Applications&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/book-review-ajax-security-addison-wesley' rel='bookmark' title='Permanent Link: Book Review:  Ajax&amp;nbsp;Security'&gt;Book Review:  Ajax&amp;nbsp;Security&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/faces-of-moo' rel='bookmark' title='Permanent Link: Faces of Moo: Represent Your&amp;nbsp;Framework!'&gt;Faces of Moo: Represent Your&amp;nbsp;Framework!&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/p_Au0dxU23Q" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/mootools-book#comments" thr:count="0" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/mootools-book/feed/atom" thr:count="0" /> <thr:total>0</thr:total> <feedburner:origLink>http://davidwalsh.name/mootools-book</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[Create Twitter-Style Dropdowns Using&#160;MooTools]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/vLJOw8pbrQE/twitter-dropdown" /> <id>http://davidwalsh.name/?p=4929</id> <updated>2010-03-11T14:05:57Z</updated> <published>2010-03-11T14:05:57Z</published> <category scheme="http://davidwalsh.name" term="CSS / Design" /><category scheme="http://davidwalsh.name" term="MooTools" /><category scheme="http://davidwalsh.name" term="XML / XHTML" /> <summary type="html"><![CDATA[Twitter does some great stuff with javascript.  What I really appreciate about what they do is that there aren&#8217;t any epic JS functionalities &#8212; they&#8217;re all simple touches.  One of those simple touches is the &#8220;Login&#8221; dropdown on their homepage.  I&#8217;ve taken some time to duplicate that functionality with MooTools.View DemoThe HTML&#60;div [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/twitter-dropdown">Create Twitter-Style Dropdowns Using&nbsp;MooTools</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/animated-button' rel='bookmark' title='Permanent Link: Create an Animated Sliding Button Using&nbsp;MooTools'>Create an Animated Sliding Button Using&nbsp;MooTools</a></li><li><a
href='http://davidwalsh.name/snook-navigation-mootools' rel='bookmark' title='Permanent Link: Create Snook-Style Navigation Using&nbsp;MooTools'>Create Snook-Style Navigation Using&nbsp;MooTools</a></li><li><a
href='http://davidwalsh.name/search-options' rel='bookmark' title='Permanent Link: Search Type Options with&nbsp;MooTools'>Search Type Options with&nbsp;MooTools</a></li><li><a
href='http://davidwalsh.name/skype-mootools' rel='bookmark' title='Permanent Link: Skype-Style Buttons Using&nbsp;MooTools'>Skype-Style Buttons Using&nbsp;MooTools</a></li><li><a
href='http://davidwalsh.name/digg-share-widget' rel='bookmark' title='Permanent Link: Digg-Style Dynamic Share Widget Using&nbsp;MooTools'>Digg-Style Dynamic Share Widget Using&nbsp;MooTools</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/twitter-dropdown">&lt;a
href="http://davidwalsh.name/dw-content/twitter-dropdown.php"&gt;&lt;img
src="http://davidwalsh.name/dw-content/fail-whale.png" alt="Twitter Dropdown" class="image" /&gt;&lt;/a&gt;&lt;p&gt;Twitter does some great stuff with javascript.  What I really appreciate about what they do is that there aren&amp;#8217;t any epic JS functionalities &amp;#8212; they&amp;#8217;re all simple touches.  One of those simple touches is the &amp;#8220;Login&amp;#8221; dropdown on their homepage.  I&amp;#8217;ve taken some time to duplicate that functionality with MooTools.&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/twitter-dropdown.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;The HTML&lt;/h2&gt;&lt;pre class="html"&gt;
&amp;lt;div id=&amp;quot;menu1&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;relative&amp;quot;&amp;gt;
	&amp;lt;a href=&amp;quot;/demos&amp;quot; title=&amp;quot;Popular MooTools Tutorials&amp;quot; id=&amp;quot;dd1&amp;quot; class=&amp;quot;dropdown&amp;quot; style=&amp;quot;width:170px;text-decoration:none;&amp;quot;&amp;gt;&amp;lt;span&amp;gt;Menu 1&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
	&amp;lt;div id=&amp;quot;dropdown1&amp;quot; class=&amp;quot;dropdown-menu&amp;quot;&amp;gt;
		&amp;lt;a href=&amp;quot;/about-david-walsh&amp;quot; title=&amp;quot;Learn a bit about me.&amp;quot;&amp;gt;About Me&amp;lt;/a&amp;gt;
		&amp;lt;a href=&amp;quot;/page/1&amp;quot; title=&amp;quot;The David Walsh Blog&amp;quot;&amp;gt;Blog&amp;lt;/a&amp;gt;
		&amp;lt;a href=&amp;quot;/chat&amp;quot; title=&amp;quot;#davidwalshblog IRC Chat&amp;quot;&amp;gt;Chat&amp;lt;/a&amp;gt;
		&amp;lt;a href=&amp;quot;/contact&amp;quot; title=&amp;quot;Contact David Walsh&amp;quot;&amp;gt;Contact Me&amp;lt;/a&amp;gt;
		&amp;lt;a href=&amp;quot;/demos&amp;quot; title=&amp;quot;CSS, PHP, jQuery, MooTools Demos&amp;quot;&amp;gt;Demos &amp;amp;amp; Downloads&amp;lt;/a&amp;gt;
		&amp;lt;a href=&amp;quot;/js&amp;quot; title=&amp;quot;ScrollSpy, Lazyload, Overlay, Context Menu&amp;quot;&amp;gt;MooTools Plugins&amp;lt;/a&amp;gt;
		&amp;lt;a href=&amp;quot;/network&amp;quot; title=&amp;quot;David Walsh Blog, Script &amp;amp;amp; Style, Band Website Template, Wynq&amp;quot;&amp;gt;Network&amp;lt;/a&amp;gt;
		&amp;lt;a href=&amp;quot;/web-development-tools&amp;quot; title=&amp;quot;JS, CSS Compression&amp;quot;&amp;gt;Web Dev Tools&amp;lt;/a&amp;gt;
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;

&amp;lt;div id=&amp;quot;menu2&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;relative&amp;quot;&amp;gt;
	&amp;lt;a href=&amp;quot;/demos&amp;quot; title=&amp;quot;Popular MooTools Tutorials&amp;quot; id=&amp;quot;dd2&amp;quot; class=&amp;quot;dropdown&amp;quot; rel=&amp;quot;dropdown2&amp;quot; style=&amp;quot;width:170px;text-decoration:none;&amp;quot;&amp;gt;&amp;lt;span&amp;gt;Menu 2&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
	&amp;lt;div id=&amp;quot;dropdown2&amp;quot; class=&amp;quot;dropdown-menu&amp;quot;&amp;gt;
		&amp;lt;p&amp;gt;Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.&amp;lt;/p&amp;gt;
	&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;
&lt;/pre&gt;&lt;p&gt;A series of DIVS wrapping a link (the dropdown &amp;#8220;trigger&amp;#8221;) and a DIV containing the menu items.&lt;/p&gt;&lt;h2&gt;The CSS&lt;/h2&gt;&lt;pre class="css"&gt;
/* dropdowns: general */
a.dropdown { background: #88bbd4; padding: 4px 6px 6px; text-decoration: none; font-weight: bold; color: #fff; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; }
a.dropdown:hover { background: #59b; }
a.dropdown { position: relative; margin-left: 3px; }
a.dropdown span { background-image: url(toggle_down_light.png); background-repeat: no-repeat; background-position: 100% 50%; padding: 4px 16px 6px 0; }
a.dropdown.dropdown-active { color:#59b; background-color:#ddeef6; }
a.dropdown.dropdown-active span { background:url(toggle_up_dark.png) 100% 50% no-repeat; }
.dropdown-menu	{ background:#ddeef6; padding:7px 12px; position:absolute; top:16px; right:0; display:none; z-index:5000; -moz-border-radius-topleft: 5px; -moz-border-radius-bottomleft: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-top-left-radius: 5px; -webkit-border-bottom-left-radius: 5px; -webkit-border-bottom-right-radius: 5px; }
	.dropdown-menu p { font-size:11px; }
.dropdown-menu a:link, .dropdown-menu a:visited	{ font-weight:bold; color:#59b; text-decoration:none; line-height:1.7em; }
.dropdown-menu a:active, .dropdown-menu a:hover { color:#555; }

/* dropdowns: specific */
#menu1			{ float:left; margin-right:20px; }
	#dropdown1	{ width:150px; }
	#dropdown1 a	{ display:block; }
#menu2			{ float:left; }
	#dropdown2	{ width:150px; font-size:11px; }
.relative		{ position:relative; }
&lt;/pre&gt;&lt;p&gt;There&amp;#8217;s a lot of CSS involved but most of it is simple visual styling as opposed to styling for javascript&amp;#8217;s sake.  Do, however, note where relative and absolute positioning is used.  The outermost DIV may be positioned absolutely if you&amp;#8217;d like.  Also note that I&amp;#8217;m not doing anything to accommodate for rounded corners in IE &amp;#8212; I recommend &lt;a
href="http://www.dillerdesign.com/experiment/DD_roundies/" rel="nofollow" target="_blank"&gt;DD_Roundies&lt;/a&gt; for that.&lt;/p&gt;&lt;h2&gt;The MooTools Javascript&lt;/h2&gt;&lt;pre class="javascript"&gt;
window.addEvent('domready',function() {
	(function($) {
		/* for keeping track of what's &amp;quot;open&amp;quot; */
		var activeClass = 'dropdown-active', showingDropdown, showingMenu, showingParent;
		/* hides the current menu */
		var hideMenu = function() {
			if(showingDropdown) {
				showingDropdown.removeClass(activeClass);
				showingMenu.setStyle('display','none');
			}
		};
		/* recurse through dropdown menus */
		$$('.dropdown').each(function(dropdown) {
			/* track elements: menu, parent */
			var menu = dropdown.getNext('div.dropdown-menu'), parent = dropdown.getParent('div');
			/* function that shows THIS menu */
			var showMenu = function() {
				hideMenu();
				showingDropdown = dropdown.addClass('dropdown-active');
				showingMenu = menu.setStyle('display','block');
				showingParent = parent;
			};
			/* function to show menu when clicked */
			dropdown.addEvent('click',function(e) {
				if(e) e.stop();
				showMenu();
			});
			/* function to show menu when someone tabs to the box */
			dropdown.addEvent('focus',function() {
				showMenu();
			});
		});
		/* hide when clicked outside */
		$(document.body).addEvent('click',function(e) {
			if(showingParent &amp;amp;&amp;amp; !e.target || !$(e.target).getParents().contains(showingParent)) { 
				hideMenu();
			}
		});
	})(document.id);
});
&lt;/pre&gt;&lt;p&gt;I&amp;#8217;ve commented to the code to illustrate what each block does.  In a nutshell:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;I create placeholder variables which will keep track of the current menu, dropdown, and parent for the opened menu&lt;em&gt;.&lt;/em&gt; This functionality is only included because I don&amp;#8217;t want more than one menu to be open at a time.&lt;/li&gt;&lt;li&gt;I create a function that hides the current menu &amp;#8212; this can be used from anywhere within the closure.&lt;/li&gt;&lt;li&gt;I cycle through each dropdown and add events to relevant elements to show and hide menus.&lt;/li&gt;&lt;li&gt;I add an event to the body to close the current menu if the user clicks outside of the menu.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;That&amp;#8217;s it!&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/twitter-dropdown.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Look forward to a MooTools Class version soon.  Also look forward to jQuery and Dojo versions!&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/twitter-dropdown"&gt;Create Twitter-Style Dropdowns Using&amp;nbsp;MooTools&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/animated-button' rel='bookmark' title='Permanent Link: Create an Animated Sliding Button Using&amp;nbsp;MooTools'&gt;Create an Animated Sliding Button Using&amp;nbsp;MooTools&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/snook-navigation-mootools' rel='bookmark' title='Permanent Link: Create Snook-Style Navigation Using&amp;nbsp;MooTools'&gt;Create Snook-Style Navigation Using&amp;nbsp;MooTools&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/search-options' rel='bookmark' title='Permanent Link: Search Type Options with&amp;nbsp;MooTools'&gt;Search Type Options with&amp;nbsp;MooTools&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/skype-mootools' rel='bookmark' title='Permanent Link: Skype-Style Buttons Using&amp;nbsp;MooTools'&gt;Skype-Style Buttons Using&amp;nbsp;MooTools&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/digg-share-widget' rel='bookmark' title='Permanent Link: Digg-Style Dynamic Share Widget Using&amp;nbsp;MooTools'&gt;Digg-Style Dynamic Share Widget Using&amp;nbsp;MooTools&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/vLJOw8pbrQE" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/twitter-dropdown#comments" thr:count="2" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/twitter-dropdown/feed/atom" thr:count="2" /> <thr:total>2</thr:total> <feedburner:origLink>http://davidwalsh.name/twitter-dropdown</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[Introducing MooTools&#160;NextPrev]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/6-Mk8xz5t9Y/mootools-nextprev" /> <id>http://davidwalsh.name/?p=4796</id> <updated>2010-03-10T14:04:46Z</updated> <published>2010-03-10T14:04:46Z</published> <category scheme="http://davidwalsh.name" term="MooTools" /><category scheme="http://davidwalsh.name" term="XML / XHTML" /> <summary type="html"><![CDATA[One thing I love doing is duplicating OS functionalities.  One of the things your OS allows you to do easily is move from one item to another.  Most of the time you&#8217;re simply trying to get to the next or the previous item.  MooTools NextPrev is a compact javascript class that allows [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/mootools-nextprev">Introducing MooTools&nbsp;NextPrev</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/mootools-elementspy' rel='bookmark' title='Permanent Link: Introducing MooTools&nbsp;ElementSpy'>Introducing MooTools&nbsp;ElementSpy</a></li><li><a
href='http://davidwalsh.name/mootools-dotter' rel='bookmark' title='Permanent Link: Introducing MooTools&nbsp;Dotter'>Introducing MooTools&nbsp;Dotter</a></li><li><a
href='http://davidwalsh.name/mootools-lazyload' rel='bookmark' title='Permanent Link: Introducing MooTools&nbsp;LazyLoad'>Introducing MooTools&nbsp;LazyLoad</a></li><li><a
href='http://davidwalsh.name/introducing-mootools-cache' rel='bookmark' title='Permanent Link: Introducing MooTools&nbsp;Cache'>Introducing MooTools&nbsp;Cache</a></li><li><a
href='http://davidwalsh.name/mootools-link-alert' rel='bookmark' title='Permanent Link: Introducing MooTools&nbsp;LinkAlert'>Introducing MooTools&nbsp;LinkAlert</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/mootools-nextprev">&lt;p&gt;&lt;a
href="http://davidwalsh.name/dw-content/next-prev.php"&gt;&lt;img
src="http://davidwalsh.name/dw-content/nextprev.jpg" alt="MooTools NextPrev" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;One thing I love doing is duplicating OS functionalities.  One of the things your OS allows you to do easily is move from one item to another.  Most of the time you&amp;#8217;re simply trying to get to the next or the previous item.  MooTools NextPrev is a compact javascript class that allows you to move about a collection of items quickly using human terms.&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/next-prev.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;The MooTools Class&lt;/h2&gt;&lt;pre class="js"&gt;
var NextPrev = new Class({
	Implements: [Options,Events],
	options: {
		baseEvent: 'keyup',
		eventContainer: document,
		eventCheckNext: function(e){
			return true;
		},
		eventCheckPrevious: function(e){ 
			return true;
		},
		onLoad: $empty,
		onNext: $empty,
		onPrevious: $empty,
		startIndex: 0
	},
	initialize: function(collection,options) {
		this.setOptions(options);
		this.collection = $$(collection);
		if(this.options.container == document) this.options.container = document.body;
		this.index = this.options.startIndex;
		if(this.options.baseEvent) {
			$(this.options.eventContainer).addEvent(this.options.baseEvent,function(e) {
				if(this.options.eventCheckNext(e)) {
					this.move.bind(this)('next');
				}
				else if(this.options.eventCheckPrevious(e)) {
					this.move.bind(this)('previous');
				}
			}.bind(this));
		}
		this.fireEvent('load',[this.collection[this.index]]);
	},
	move: function(norp) {
		var previous = this.index;
		switch($type(norp)) {
			case 'string':
				var ev = 'next';
				if(norp == 'next') {
					var plus = this.index + 1;
					this.index = this.collection[plus] ? plus : 0;
				}
				else {
					var minus = this.index - 1;
					this.index = this.collection[minus] ? minus : this.collection.length-1;
					ev = 'previous';
				}
				this.fireEvent(ev,[this.collection[this.index],this.collection[previous]]);
				break;
			case 'element':
				this.index = this.collection.indexOf(norp) || 0;
				break;
			default:
				this.index = norp;
				break;
		}
		this.fireEvent('change',[this.collection[this.index],this.collection[previous]]);
		return this;
	}
});
&lt;/pre&gt;&lt;p&gt;The following are arguments, options, and events for NextPrev:&lt;/p&gt;&lt;h3&gt;Arguments&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;span
class="function"&gt;collection&lt;/span&gt;: The collection of elements..&lt;/li&gt;&lt;li&gt;&lt;span
class="function"&gt;options&lt;/span&gt;: The instance options.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Options&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;span
class="function"&gt;baseEvent&lt;/span&gt;: &lt;em&gt;(defaults to &amp;#8216;keyup&amp;#8217;)&lt;/em&gt; The event to listen to.&lt;/li&gt;&lt;li&gt;&lt;span
class="function"&gt;eventContainer&lt;/span&gt;: &lt;em&gt;(defaults to document)&lt;/em&gt; The event listener container.&lt;/li&gt;&lt;li&gt;&lt;span
class="function"&gt;eventCheckNext&lt;/span&gt;: &lt;em&gt;(defaults to function)&lt;/em&gt; The function that decides if the conditions to trigger a &amp;#8220;next&amp;#8221; have been met.&lt;/li&gt;&lt;li&gt;&lt;span
class="function"&gt;eventCheckPrevious&lt;/span&gt;: &lt;em&gt;(defaults to function)&lt;/em&gt; The function that decides if the conditions to trigger a &amp;#8220;previous&amp;#8221; have been met.&lt;/li&gt;&lt;li&gt;&lt;span
class="function"&gt;startIndex&lt;/span&gt;: &lt;em&gt;(defaults to 0)&lt;/em&gt; The starting index for the collection.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Events&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;span
class="function"&gt;change&lt;/span&gt;: Fired when the index changes.&lt;/li&gt;&lt;li&gt;&lt;span
class="function"&gt;load&lt;/span&gt;: Fired every time the class is initialized.&lt;/li&gt;&lt;li&gt;&lt;span
class="function"&gt;next&lt;/span&gt;: Fired when the next directive is triggered.&lt;/li&gt;&lt;li&gt;&lt;span
class="function"&gt;previous&lt;/span&gt;: Fired when the previous directive is triggered.&lt;/li&gt;&lt;/ul&gt;&lt;h3&gt;Public Methods&lt;/h3&gt;&lt;ul&gt;&lt;li&gt;&lt;span
class="function"&gt;move&lt;/span&gt;: May be passed the Strings &amp;#8220;next&amp;#8221; or &amp;#8220;prev&amp;#8221;, or a DOM node.&lt;/li&gt;&lt;/ul&gt;&lt;h2&gt;Sample Usage&lt;/h2&gt;&lt;pre class="js"&gt;
var np2 = new NextPrev($$('#images img'),{
	eventCheckNext: function(e) {
		if(e) e.stop(e);
		return e.key == 'right';
	},
	eventCheckPrevious: function(e) {
		if(e) e.stop(e);
		return e.key == 'left';
	},
	onNext: function(cur,prev) {
		prev.removeClass('featured');
		cur.addClass('featured');
	},
	onPrevious: function(cur,prev) {
		prev.removeClass('featured');
		cur.addClass('featured');
	},
	onLoad: function(cur) {
		cur.addClass('featured');
	}
});
&lt;/pre&gt;&lt;p&gt;The code above hijacks the &amp;#8220;left&amp;#8221; and &amp;#8220;right&amp;#8221; keys, moving forward and backward in the collection depending on which key was pressed.&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/next-prev.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;NextPrev is extremely simple but also quite flexible.  You decide the events, keys, actions, etc &amp;#8212; the plugin simple allows for simple control of position in the list.  Have ideas for this class?  Know what you&amp;#8217;d use it for?  Let me know!&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/mootools-nextprev"&gt;Introducing MooTools&amp;nbsp;NextPrev&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-elementspy' rel='bookmark' title='Permanent Link: Introducing MooTools&amp;nbsp;ElementSpy'&gt;Introducing MooTools&amp;nbsp;ElementSpy&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-dotter' rel='bookmark' title='Permanent Link: Introducing MooTools&amp;nbsp;Dotter'&gt;Introducing MooTools&amp;nbsp;Dotter&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-lazyload' rel='bookmark' title='Permanent Link: Introducing MooTools&amp;nbsp;LazyLoad'&gt;Introducing MooTools&amp;nbsp;LazyLoad&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/introducing-mootools-cache' rel='bookmark' title='Permanent Link: Introducing MooTools&amp;nbsp;Cache'&gt;Introducing MooTools&amp;nbsp;Cache&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-link-alert' rel='bookmark' title='Permanent Link: Introducing MooTools&amp;nbsp;LinkAlert'&gt;Introducing MooTools&amp;nbsp;LinkAlert&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/6-Mk8xz5t9Y" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/mootools-nextprev#comments" thr:count="6" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/mootools-nextprev/feed/atom" thr:count="6" /> <thr:total>6</thr:total> <feedburner:origLink>http://davidwalsh.name/mootools-nextprev</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[Create a Simple News Scroller Using&#160;Dojo]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/I8s9Z63_jZI/news-scroller-dojo" /> <id>http://davidwalsh.name/?p=4925</id> <updated>2010-03-09T15:06:14Z</updated> <published>2010-03-09T14:09:36Z</published> <category scheme="http://davidwalsh.name" term="CSS / Design" /><category scheme="http://davidwalsh.name" term="Javascript" /><category scheme="http://davidwalsh.name" term="XML / XHTML" /> <summary type="html"><![CDATA[My journey into Dojo javascript has been exciting and I&#8217;m continuing to learn more as I port MooTools scripts to Dojo.  My latest experiment is porting a simple new scroller from MooTools to Dojo.  The code is very similar!View DemoThe HTML
News Item 1Pellentesque habitant morbi...Read More
News Item 2Pellentesque habitant morbi...Read MoreThe news items [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/news-scroller-dojo">Create a Simple News Scroller Using&nbsp;Dojo</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/mootools-scroller' rel='bookmark' title='Permanent Link: Create a Simple News Scroller Using MooTools, Part I:  The&nbsp;Basics'>Create a Simple News Scroller Using MooTools, Part I:  The&nbsp;Basics</a></li><li><a
href='http://davidwalsh.name/mootools-slideshow-ii' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part II:  Controls and&nbsp;Events'>Create a Simple Slideshow Using MooTools, Part II:  Controls and&nbsp;Events</a></li><li><a
href='http://davidwalsh.name/mootools-slideshow' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using&nbsp;MooTools'>Create a Simple Slideshow Using&nbsp;MooTools</a></li><li><a
href='http://davidwalsh.name/create-a-simple-slideshow-iii' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part III: Creating a&nbsp;Class'>Create a Simple Slideshow Using MooTools, Part III: Creating a&nbsp;Class</a></li><li><a
href='http://davidwalsh.name/slideshow-thumbnails-captions' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part IV: Thumbnails and&nbsp;Captions'>Create a Simple Slideshow Using MooTools, Part IV: Thumbnails and&nbsp;Captions</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/news-scroller-dojo">&lt;a
href="http://davidwalsh.name/dw-content/news-scroller-dojo.php" class="demo"&gt;&lt;img
src="http://davidwalsh.name/dw-content/news-scroller-1.jpg" alt="" class="image" /&gt;&lt;/a&gt;&lt;p&gt;My journey into Dojo javascript has been exciting and I&amp;#8217;m continuing to learn more as I port MooTools scripts to Dojo.  My latest experiment is porting a &lt;a
href="http://davidwalsh.name/mootools-scroller"&gt;simple new scroller from MooTools&lt;/a&gt; to Dojo.  The code is very similar!&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/news-scroller-dojo.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;The HTML&lt;/h2&gt;&lt;pre class="html"&gt;
&lt;div id="news-feed"&gt;
	&lt;ul&gt;
		&lt;li&gt;&lt;strong style="font-size:14px;"&gt;News Item 1&lt;/strong&gt;&lt;br /&gt;Pellentesque habitant morbi...&lt;a href="#"&gt;Read More&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;strong style="font-size:14px;"&gt;News Item 2&lt;/strong&gt;&lt;br /&gt;Pellentesque habitant morbi...&lt;a href="/news/2"&gt;Read More&lt;/a&gt;&lt;/li&gt;
		
	&lt;/ul&gt;
&lt;/div&gt;
&lt;/pre&gt;&lt;p&gt;The news items are placed into list items.  The UL  will be the element that&amp;#8217;s animated.&lt;/p&gt;&lt;h2&gt;The CSS&lt;/h2&gt;&lt;pre class="css"&gt;
#news-feed	 { height:200px; width:300px; overflow:hidden; position:relative; border:1px solid #ccc; background:#eee; }
#news-feed ul	{ position:absolute; top:0; left:0; list-style-type:none; padding:0; margin:0; }
#news-feed ul li { min-height:180px; font-size:12px; margin:0; padding:10px; overflow:hidden; }
&lt;/pre&gt;&lt;p&gt;The absolute positioning is essential to proper animation.  Unlike my MooTools example, this example no longer requires a fixed height for each news item.  I did add a minimum height so only one item shows up within the scroller window at a time.&lt;/p&gt;&lt;h2&gt;The Dojo Javascript&lt;/h2&gt;&lt;pre class="js"&gt;
dojo.require('dojo.NodeList-fx');
dojo.addOnLoad(function() {
	/* settings */
	var list = dojo.query('#news-feed ul'),
		items = list.query("li"),
		showDuration = 3000,
		scrollDuration = 500,
		scrollTopDuration = 200,
		index = 0,
		interval;

	/* movement */
	var start = function() { interval = setInterval(move,showDuration); };
	var stop = function() { if(interval) clearInterval(interval); };
	var reset = function() {
	    list.anim({ top: 0}, scrollTopDuration, null, start);
	};
	/* action! */
	var move = function() {
	    list.anim({ top: (0 - (dojo.coords(items[++index]).t)) }, scrollDuration, null, function(){
			if(index == items.length - 1) {
				index = 0-1;
				stop();
				setTimeout(reset,showDuration);
			}
	    });
	};

	/* stop and start during mouseenter, mouseleave  */
	list.onmouseenter(stop).onmouseleave(start);

	/* go! */
	start();
});
&lt;/pre&gt;&lt;p&gt;This is where I have the epic description&amp;#8230;but the above code (at least for MooTools users) should look familiar.  The logic is exactly the same but the code uses &lt;span
class="function"&gt;dojo.*&lt;/span&gt; methods instead of MooTools&amp;#8217; &lt;span
class="function"&gt;Fx&lt;/span&gt;, &lt;span
class="function"&gt;$$&lt;/span&gt;, &lt;span
class="function"&gt;$&lt;/span&gt;, and &lt;span
class="function"&gt;Element.Dimensions&lt;/span&gt; methods.&lt;/p&gt;&lt;h2&gt;The MooTools Javascript&lt;/h2&gt;&lt;pre class="js"&gt;
window.addEvent('domready',function() {
	/* settings */
	var list = $('news-feed').getFirst('ul');
	var items = list.getElements('li');
	var showDuration = 3000;
	var scrollDuration = 500;
	var index = 0;
	var height = items[0].getSize().y;
	/* action func */
	var move = function() {
		list.set('tween',{
			duration: scrollDuration,
			onComplete: function() {
				if(index == items.length - 1) {
					index = 0 - 1;
					list.scrollTo(0,0);
				}
			}
		}).tween('top',0 - (++index * height));
	};
	/* go! */
	window.addEvent('load',function() {		
		move.periodical(showDuration);
	});
});
&lt;/pre&gt;&lt;p&gt;The above code was taken from my original post.  Take a moment to compare the Dojo and MooTools code.&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/news-scroller-dojo.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;What do you think?  Three Dojo posts in &amp;#8212; what are your thoughts about Dojo to this point?&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/news-scroller-dojo"&gt;Create a Simple News Scroller Using&amp;nbsp;Dojo&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-scroller' rel='bookmark' title='Permanent Link: Create a Simple News Scroller Using MooTools, Part I:  The&amp;nbsp;Basics'&gt;Create a Simple News Scroller Using MooTools, Part I:  The&amp;nbsp;Basics&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-slideshow-ii' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part II:  Controls and&amp;nbsp;Events'&gt;Create a Simple Slideshow Using MooTools, Part II:  Controls and&amp;nbsp;Events&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-slideshow' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using&amp;nbsp;MooTools'&gt;Create a Simple Slideshow Using&amp;nbsp;MooTools&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/create-a-simple-slideshow-iii' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part III: Creating a&amp;nbsp;Class'&gt;Create a Simple Slideshow Using MooTools, Part III: Creating a&amp;nbsp;Class&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/slideshow-thumbnails-captions' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part IV: Thumbnails and&amp;nbsp;Captions'&gt;Create a Simple Slideshow Using MooTools, Part IV: Thumbnails and&amp;nbsp;Captions&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/I8s9Z63_jZI" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/news-scroller-dojo#comments" thr:count="2" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/news-scroller-dojo/feed/atom" thr:count="2" /> <thr:total>2</thr:total> <feedburner:origLink>http://davidwalsh.name/news-scroller-dojo</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[&#8220;MooTools as a General Purpose Application Framework&#8221; by Christoph&#160;Pojer]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/KDBF0XHHF5I/mootools-video" /> <id>http://davidwalsh.name/?p=4928</id> <updated>2010-03-08T21:31:21Z</updated> <published>2010-03-08T21:31:21Z</published> <category scheme="http://davidwalsh.name" term="MooTools" /> <summary type="html"><![CDATA[I wanted to bring attention to an outstanding presentation given by MooTools Core Developer Christoph Pojer.  Given at FOSDEM 2010, Christoph provides an overview of what MooTools is, who should use it, how it should be used.  Examples are given throughout the presentation. I highly recommend MooTools users of all experience levels watch this video, as [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/mootools-video">&#8220;MooTools as a General Purpose Application Framework&#8221; by Christoph&nbsp;Pojer</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/php5-cms-framework-development' rel='bookmark' title='Permanent Link: Book Review:  PHP5 CMS Framework&nbsp;Development'>Book Review:  PHP5 CMS Framework&nbsp;Development</a></li><li><a
href='http://davidwalsh.name/javascript-framework-considerations' rel='bookmark' title='Permanent Link: 8 Considerations For Choosing Your Javascript&nbsp;Framework'>8 Considerations For Choosing Your Javascript&nbsp;Framework</a></li><li><a
href='http://davidwalsh.name/contribute-javascript-framework' rel='bookmark' title='Permanent Link: 5 Ways to Contribute to Your Favorite Javascript&nbsp;Framework'>5 Ways to Contribute to Your Favorite Javascript&nbsp;Framework</a></li><li><a
href='http://davidwalsh.name/javascript-frameworks-fight-mootools-jquery-prototype' rel='bookmark' title='Permanent Link: When Javascript Frameworks&nbsp;Collide'>When Javascript Frameworks&nbsp;Collide</a></li><li><a
href='http://davidwalsh.name/mootools-dollar-safe-mode' rel='bookmark' title='Permanent Link: MooTools, Framework Compatibility, and Dollar $afe&nbsp;Mode'>MooTools, Framework Compatibility, and Dollar $afe&nbsp;Mode</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/mootools-video">&lt;p&gt;I wanted to bring attention to an outstanding presentation given by MooTools Core Developer &lt;a
href="http://cpojer.net" target="_blank" rel="nofollow"&gt;Christoph Pojer&lt;/a&gt;.  Given at &lt;a
href="http://fosdem.org/2010/" target="_blank" rel="nofollow"&gt;FOSDEM&lt;/a&gt; 2010, Christoph provides an overview of what MooTools is, who should use it, how it should be used.  Examples are given throughout the presentation. &lt;/p&gt; &lt;br
/&gt; &lt;object
width="425" height="344"&gt;&lt;param
name="movie" value="http://www.youtube.com/v/6nOVQDMOvvE&amp;#038;color1=0xb1b1b1&amp;#038;color2=0xcfcfcf&amp;#038;hl=en_US&amp;#038;feature=player_embedded&amp;#038;fs=1"&gt;&lt;/param&gt;&lt;param
name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param
name="allowScriptAccess" value="always"&gt;&lt;/param&gt;&lt;embed
src="http://www.youtube.com/v/6nOVQDMOvvE&amp;#038;color1=0xb1b1b1&amp;#038;color2=0xcfcfcf&amp;#038;hl=en_US&amp;#038;feature=player_embedded&amp;#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;p&gt; I highly recommend MooTools users of all experience levels watch this video, as well as jQuery or Dojo users looking to simply understand what this framework is about.&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/mootools-video"&gt;&amp;#8220;MooTools as a General Purpose Application Framework&amp;#8221; by Christoph&amp;nbsp;Pojer&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/php5-cms-framework-development' rel='bookmark' title='Permanent Link: Book Review:  PHP5 CMS Framework&amp;nbsp;Development'&gt;Book Review:  PHP5 CMS Framework&amp;nbsp;Development&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/javascript-framework-considerations' rel='bookmark' title='Permanent Link: 8 Considerations For Choosing Your Javascript&amp;nbsp;Framework'&gt;8 Considerations For Choosing Your Javascript&amp;nbsp;Framework&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/contribute-javascript-framework' rel='bookmark' title='Permanent Link: 5 Ways to Contribute to Your Favorite Javascript&amp;nbsp;Framework'&gt;5 Ways to Contribute to Your Favorite Javascript&amp;nbsp;Framework&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/javascript-frameworks-fight-mootools-jquery-prototype' rel='bookmark' title='Permanent Link: When Javascript Frameworks&amp;nbsp;Collide'&gt;When Javascript Frameworks&amp;nbsp;Collide&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-dollar-safe-mode' rel='bookmark' title='Permanent Link: MooTools, Framework Compatibility, and Dollar $afe&amp;nbsp;Mode'&gt;MooTools, Framework Compatibility, and Dollar $afe&amp;nbsp;Mode&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/KDBF0XHHF5I" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/mootools-video#comments" thr:count="0" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/mootools-video/feed/atom" thr:count="0" /> <thr:total>0</thr:total> <feedburner:origLink>http://davidwalsh.name/mootools-video</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[Remove Broken Images Using&#160;Dojo]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/T-RyuXs-aNw/remove-images-dojo" /> <id>http://davidwalsh.name/?p=4921</id> <updated>2010-03-02T13:22:47Z</updated> <published>2010-03-02T13:22:47Z</published> <category scheme="http://davidwalsh.name" term="Javascript" /><category scheme="http://davidwalsh.name" term="XML / XHTML" /> <summary type="html"><![CDATA[In an effort to get better with the Dojo Toolkit, I&#8217;ve decided to port yet another one of my previous posts:  Remove Broken Images Using MooTools or jQuery.  Broken images are an eyesore to any website so there&#8217;s no point to keeping them in the page.  Here&#8217;s how you can remove them [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/remove-images-dojo">Remove Broken Images Using&nbsp;Dojo</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/remove-broken-images' rel='bookmark' title='Permanent Link: Remove Broken Images Using MooTools or&nbsp;jQuery'>Remove Broken Images Using MooTools or&nbsp;jQuery</a></li><li><a
href='http://davidwalsh.name/email-image-error-mootools' rel='bookmark' title='Permanent Link: Send Email Notifications for Broken Images Using MooTools&nbsp;Ajax'>Send Email Notifications for Broken Images Using MooTools&nbsp;Ajax</a></li><li><a
href='http://davidwalsh.name/broken-images-jquery-ajax' rel='bookmark' title='Permanent Link: Send Email Notifications for Broken Images Using jQuery&nbsp;Ajax'>Send Email Notifications for Broken Images Using jQuery&nbsp;Ajax</a></li><li><a
href='http://davidwalsh.name/link-nudging-dojo' rel='bookmark' title='Permanent Link: Link Nudging Using&nbsp;Dojo'>Link Nudging Using&nbsp;Dojo</a></li><li><a
href='http://davidwalsh.name/quickboxes-dojo' rel='bookmark' title='Permanent Link: QuickBoxes for&nbsp;Dojo'>QuickBoxes for&nbsp;Dojo</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/remove-images-dojo">&lt;p&gt;In an effort to get better with the Dojo Toolkit, I&amp;#8217;ve decided to port yet another one of my previous posts: &lt;a
href="http://davidwalsh.name/remove-broken-images"&gt;Remove Broken Images Using MooTools or jQuery&lt;/a&gt;.  Broken images are an eyesore to any website so there&amp;#8217;s no point to keeping them in the page.  Here&amp;#8217;s how you can remove them on the client side.&lt;/p&gt;&lt;h2&gt;The Dojo Javascript&lt;/h2&gt;&lt;pre class="js"&gt;
dojo.ready(function() {
	dojo.query('img').forEach(function(img){
		dojo.connect(img,'onerror',function() {
			dojo.destroy(img);
		});
	});
});
&lt;/pre&gt;&lt;p&gt;Just as simple as jQuery and MooTools &amp;#8212; just a different syntax!&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/remove-images-dojo"&gt;Remove Broken Images Using&amp;nbsp;Dojo&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/remove-broken-images' rel='bookmark' title='Permanent Link: Remove Broken Images Using MooTools or&amp;nbsp;jQuery'&gt;Remove Broken Images Using MooTools or&amp;nbsp;jQuery&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/email-image-error-mootools' rel='bookmark' title='Permanent Link: Send Email Notifications for Broken Images Using MooTools&amp;nbsp;Ajax'&gt;Send Email Notifications for Broken Images Using MooTools&amp;nbsp;Ajax&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/broken-images-jquery-ajax' rel='bookmark' title='Permanent Link: Send Email Notifications for Broken Images Using jQuery&amp;nbsp;Ajax'&gt;Send Email Notifications for Broken Images Using jQuery&amp;nbsp;Ajax&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/link-nudging-dojo' rel='bookmark' title='Permanent Link: Link Nudging Using&amp;nbsp;Dojo'&gt;Link Nudging Using&amp;nbsp;Dojo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/quickboxes-dojo' rel='bookmark' title='Permanent Link: QuickBoxes for&amp;nbsp;Dojo'&gt;QuickBoxes for&amp;nbsp;Dojo&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/T-RyuXs-aNw" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/remove-images-dojo#comments" thr:count="3" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/remove-images-dojo/feed/atom" thr:count="3" /> <thr:total>3</thr:total> <feedburner:origLink>http://davidwalsh.name/remove-images-dojo</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[Link Nudging Using&#160;Dojo]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/jMx7h9P6F78/link-nudging-dojo" /> <id>http://davidwalsh.name/?p=4909</id> <updated>2010-03-03T15:30:04Z</updated> <published>2010-03-01T13:58:20Z</published> <category scheme="http://davidwalsh.name" term="CSS / Design" /><category scheme="http://davidwalsh.name" term="Javascript" /><category scheme="http://davidwalsh.name" term="XML / XHTML" /> <summary type="html"><![CDATA[In the past we&#8217;ve tinkered with link nudging with MooTools and link nudging with jQuery.  In an effort to familiarize myself with other javascript frameworks, we&#8217;re going to try to duplicate that effect with another awesome framework:  Dojo.View DemoThe Javascript:  Attempt 1dojo.addOnLoad(function() {
var links = dojo.query('a.nudge');
//foreach...
dojo.forEach(links,function(link) {
var left = dojo.style(link,'paddingLeft');
dojo.connect(link,'onmouseenter',function() {
dojo.animateProperty({
node:link,
properties: {
paddingLeft: [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/link-nudging-dojo">Link Nudging Using&nbsp;Dojo</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/jquery-link-nudging' rel='bookmark' title='Permanent Link: jQuery Link&nbsp;Nudging'>jQuery Link&nbsp;Nudging</a></li><li><a
href='http://davidwalsh.name/news-scroller-dojo' rel='bookmark' title='Permanent Link: Create a Simple News Scroller Using&nbsp;Dojo'>Create a Simple News Scroller Using&nbsp;Dojo</a></li><li><a
href='http://davidwalsh.name/quickboxes-dojo' rel='bookmark' title='Permanent Link: QuickBoxes for&nbsp;Dojo'>QuickBoxes for&nbsp;Dojo</a></li><li><a
href='http://davidwalsh.name/remove-images-dojo' rel='bookmark' title='Permanent Link: Remove Broken Images Using&nbsp;Dojo'>Remove Broken Images Using&nbsp;Dojo</a></li><li><a
href='http://davidwalsh.name/mootools-link-nudging' rel='bookmark' title='Permanent Link: MooTools Link&nbsp;Nudging'>MooTools Link&nbsp;Nudging</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/link-nudging-dojo">&lt;a
href="http://davidwalsh.name/dw-content/dojo-nudge.php"&gt;&lt;img
src="http://davidwalsh.name/dw-content/dojo-logo.jpg" alt="Dojo Toolkit" class="image" /&gt;&lt;/a&gt;&lt;p&gt;In the past we&amp;#8217;ve tinkered with &lt;a
href="http://davidwalsh.name/mootools-link-nudging"&gt;link nudging with MooTools&lt;/a&gt; and &lt;a
href="http://davidwalsh.name/jquery-link-nudging"&gt;link nudging with jQuery&lt;/a&gt;.  In an effort to familiarize myself with other javascript frameworks, we&amp;#8217;re going to try to duplicate that effect with another awesome framework:  Dojo.&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/dojo-nudge.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;The Javascript:  Attempt 1&lt;/h2&gt;&lt;pre class="js"&gt;
dojo.addOnLoad(function() {
	var links = dojo.query('a.nudge');
	//foreach...
	dojo.forEach(links,function(link) {
		var left = dojo.style(link,'paddingLeft');
		dojo.connect(link,'onmouseenter',function() {
			dojo.animateProperty({
				node:link,
				properties: {
					paddingLeft: (left + 10)
				}
			}).play();
		});
		dojo.connect(link,'onmouseleave',function() {
			dojo.animateProperty({
				node:link,
				properties: {
					paddingLeft: left
				}
			}).play();
		});
	});
});
&lt;/pre&gt;&lt;p&gt;Once the DOM is ready, we use the &lt;span
class="function"&gt;dojo.query&lt;/span&gt; method to find all of the links to nudge.  For every link we find, we record its original left padding and add &lt;span
class="function"&gt;mouseenter&lt;/span&gt; and &lt;span
class="function"&gt;mouseleave&lt;/span&gt; events to each link to animate its left padding.&lt;/p&gt;&lt;h2&gt;The Javascript:  Better Solution&lt;/h2&gt;&lt;pre class="js"&gt;
dojo.ready(function() {
	dojo.query('a.nudge').forEach(function(link){
		var left = dojo.style(link,'paddingLeft');
		dojo.connect(link,'onmouseenter',function() {
		    dojo.anim(link, { paddingLeft:20 });
		});
		dojo.connect(link,'onmouseleave',function() {
		    dojo.anim(link, { paddingLeft:left });
		});
	});
});
&lt;/pre&gt;&lt;p&gt;Dojo lead Pete Higgins showed me a more condensed version of his script.&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/dojo-nudge.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Simple, no?  The best way to learn to use any javascript framework is to duplicate a given set of code you are familiar with, much like we did here.  What do you think about this Dojo example?  Look close to jQuery and MooTools?&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/link-nudging-dojo"&gt;Link Nudging Using&amp;nbsp;Dojo&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/jquery-link-nudging' rel='bookmark' title='Permanent Link: jQuery Link&amp;nbsp;Nudging'&gt;jQuery Link&amp;nbsp;Nudging&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/news-scroller-dojo' rel='bookmark' title='Permanent Link: Create a Simple News Scroller Using&amp;nbsp;Dojo'&gt;Create a Simple News Scroller Using&amp;nbsp;Dojo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/quickboxes-dojo' rel='bookmark' title='Permanent Link: QuickBoxes for&amp;nbsp;Dojo'&gt;QuickBoxes for&amp;nbsp;Dojo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/remove-images-dojo' rel='bookmark' title='Permanent Link: Remove Broken Images Using&amp;nbsp;Dojo'&gt;Remove Broken Images Using&amp;nbsp;Dojo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-link-nudging' rel='bookmark' title='Permanent Link: MooTools Link&amp;nbsp;Nudging'&gt;MooTools Link&amp;nbsp;Nudging&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/jMx7h9P6F78" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/link-nudging-dojo#comments" thr:count="8" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/link-nudging-dojo/feed/atom" thr:count="8" /> <thr:total>8</thr:total> <feedburner:origLink>http://davidwalsh.name/link-nudging-dojo</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[jQuery Podcast &amp; Essential jQuery and MooTools&#160;Snippets]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/8pC0nq816KM/jquery-podcast" /> <id>http://davidwalsh.name/?p=4892</id> <updated>2010-03-03T22:28:01Z</updated> <published>2010-02-26T15:24:03Z</published> <category scheme="http://davidwalsh.name" term="Blog" /><category scheme="http://davidwalsh.name" term="jQuery" /> <summary type="html"><![CDATA[Many of you probably already know this but I like to consider myself a bit of a javascript chameleon.  If you know that then you probably know I&#8217;m a MooTools fanatic that periodically dabbles with jQuery.  I&#8217;m happy to announce that I was able to join Elijah Manor and Ralph Whitbeck on the [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/jquery-podcast">jQuery Podcast &#038; Essential jQuery and MooTools&nbsp;Snippets</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/faceoff-show' rel='bookmark' title='Permanent Link: David Walsh on the Faceoff Show&nbsp;Podcast'>David Walsh on the Faceoff Show&nbsp;Podcast</a></li><li><a
href='http://davidwalsh.name/5-simple-ways-programmers-and-designers-should-give-back' rel='bookmark' title='Permanent Link: 5 Simple Ways Programmers and Designers Should Give&nbsp;Back'>5 Simple Ways Programmers and Designers Should Give&nbsp;Back</a></li><li><a
href='http://davidwalsh.name/color-palette-generator-jquery' rel='bookmark' title='Permanent Link: Color Palette Generator Using&nbsp;jQuery'>Color Palette Generator Using&nbsp;jQuery</a></li><li><a
href='http://davidwalsh.name/one-year-anniversary' rel='bookmark' title='Permanent Link: One Year Anniversary&nbsp;Today!'>One Year Anniversary&nbsp;Today!</a></li><li><a
href='http://davidwalsh.name/image-protector-plugin-for-jquery' rel='bookmark' title='Permanent Link: dwImageProtector Plugin for&nbsp;jQuery'>dwImageProtector Plugin for&nbsp;jQuery</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/jquery-podcast">&lt;a
href="http://blog.jquery.com/2010/02/26/the-official-jquery-podcast-episode-13-david-walsh/" rel="nofollow"&gt;&lt;img
src="http://davidwalsh.name/dw-content/jquery-logo.jpg" class="image" alt="jQuery" /&gt;&lt;/a&gt;&lt;p&gt;Many of you probably already know this but I like to consider myself a bit of a javascript chameleon.  If you know that then you probably know I&amp;#8217;m a MooTools fanatic that periodically dabbles with jQuery.  I&amp;#8217;m happy to announce that I was able to join Elijah Manor and Ralph Whitbeck on the jQuery podcast this past week to talk jQuery, MooTools, and web development in general.  Head on over to the &lt;a
href="http://blog.jquery.com/2010/02/26/the-official-jquery-podcast-episode-13-david-walsh/" rel="nofollow"&gt;jQuery blog&lt;/a&gt; for more information or &lt;a
href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewPodcast?id=339835419" rel="nofollow"&gt;iTunes to grab the podcast&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;As an extension of my podcast appearance, I wanted to share a few code snippets to make your introduction to MooTools or jQuery easier.&lt;/p&gt;&lt;h2&gt;Featured jQuery &amp;amp; MooTools Snippets&lt;/h2&gt;&lt;h3&gt;Using jQuery and MooTools Together&lt;/h3&gt;&lt;p&gt;Did you know that you can use jQuery and MooTools within the same page?  It&amp;#8217;s easy to!&lt;/p&gt;&lt;pre class="js"&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;moo1.2.4.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;jquery-1.4.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
window.addEvent('domready',function() { //moo stuff
	$('p').css('border','1px solid #fc0'); //jquery
});
&amp;lt;/script&amp;gt;
&lt;/pre&gt;&lt;h3&gt;Using Sizzle Within MooTools&lt;/h3&gt;&lt;p&gt;Prefer to use jQuery&amp;#8217;s selector engine within MooTools?  No problem &amp;#8212; here&amp;#8217;s how:&lt;/p&gt;&lt;pre class="js"&gt;
//just as reader &amp;quot;Ryan&amp;quot; mentioned....
Window.$$ = function(selector){
	return new Elements(new Sizzle(selector));
}
&lt;/pre&gt;&lt;h3&gt;jQuery and MooTools Link Nudging&lt;/h3&gt;&lt;p&gt;Link nudging is a classy, subtle effect that makes your websites more dynamic.&lt;/p&gt;&lt;pre class="js"&gt;
/* jquery */
$.fn.nudge = function(params) {
	//set default parameters
	params = $.extend({
		amount: 20,
		duration: 300,
		property: 'padding',
		direction: 'left',
		toCallback: function() {},
		fromCallback: function() {}
	}, params);
	//For every element meant to nudge...
	this.each(function() {
		//variables
		var $t = $(this);
		var $p = params;
		var dir = $p.direction;
		var prop = $p.property + dir.substring(0,1).toUpperCase() + dir.substring(1,dir.length);
		var initialValue = $t.css(prop);
		/* fx */
		var go = {}; go[prop] = parseInt($p.amount) + parseInt(initialValue);
		var bk = {}; bk[prop] = initialValue;
		
		//Proceed to nudge on hover
		$t.hover(function() {
					$t.stop().animate(go, $p.duration, '', $p.toCallback);
				}, function() {
					$t.stop().animate(bk, $p.duration, '', $p.fromCallback);
				});
	});
	return this;
};

/* jquery usages */
$(document).ready(function() {
	/* usage 1 */
	$('#nudgeUs li a').nudge();
	/* usage 2 */
	$('#nudgeUs2 li a').nudge({
		property: 'margin',
		direction: 'left',
		amount: 30,
		duration: 400,
		toCallback: function() { $(this).css('color','#f00'); },
		fromCallback: function() { $(this).css('color','#000'); }
	});
});

/* mootols link nudge */
window.addEvent('domready',function() {
	$$('#nudges a').addEvents({
		'mouseenter': function() { this.tween('padding-left',20); },
		'mouseleave': function() { this.tween('padding-left',0); }
	});
});
&lt;/pre&gt;&lt;div
class="actions"&gt; &lt;a
href="http://davidwalsh.name/dw-content/jquery-link-nudge-plugin.php" class="demo"&gt;View jQuery Demo&lt;/a&gt; &lt;a
href="http://davidwalsh.name/dw-content/mootools-link-nudge.php" class="demo"&gt;View MooTools Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;jQuery and MooTools Search Bookmarklets&lt;/h3&gt;&lt;p&gt;These bookmarklets will allow you to highlight text on a page and search the jQuery or MooTools websites to learn more about the phrase.&lt;/p&gt; &lt;a
href="javascript:(function()%7Bvar%20d=document,w=window,ds=d.getSelection,ws=w.getSelection,ss=d.selection,e=encodeURIComponent;t=(ws)%3Fws():(ds)%3Fds():(ss)%3Fss.createRange().text:'';t=(t.toString().length)%3Ft:prompt('Please select the code you would like to research.','');if(t)%7Ba='http://docs.jquery.com/Special:Search?search=';u=a+e(t);f=function()%7Bx=w.open(u,'nfx','scrollbars=1,toolbar=0,resizable=1,status=1,width=600,height=600');if(!x)w.location.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(f,0);else%20f();%7D%7D)();" class="article"&gt;jQuery Bookmarklet&lt;/a&gt;&lt;a
href="javascript:(function()%7Bvar%20d=document,w=window,ds=d.getSelection,ws=w.getSelection,ss=d.selection,e=encodeURIComponent;t=(ws)%3Fws():(ds)%3Fds():(ss)%3Fss.createRange().text:'';t=(t.toString().length)%3Ft:prompt('Please select the code you would like to research.','');if(t)%7Ba='http://mootools.net/search/?search=1&amp;#038;query=';u=a+e(t);f=function()%7Bx=w.open(u,'nfx','scrollbars=1,toolbar=0,resizable=1,status=1,width=800,height=600');if(!x)w.location.href=u;%7D;if(/Firefox/.test(navigator.userAgent))setTimeout(f,0);else%20f();%7D%7D)();" class="article"&gt;MooTools Bookmarklet&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h3&gt;jQuery Events within MooTools&lt;/h3&gt;&lt;p&gt;The following MooTools snippet allows you to use jQuery-style syntax for event listening.&lt;/p&gt;&lt;pre class="js"&gt;
//hash the element.natives so we can do stuff with it
var hash = new Hash(Element.NativeEvents);
//remove items that need to be replaced, add their replacements
hash.erase('mouseover').erase('mouseout').erase('DOMMouseScroll');
hash.include('mouseenter',1).include('mouseleave',1);
//initialize this
var eventHash = new Hash({});
//for every event type, add to our hash
hash.getKeys().each(function(event){
	eventHash[event] = function(fn) {
		this.addEvent(event,fn);
		return this;
	}
});
//make it happen
Element.implement(eventHash);
&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;h2&gt;JavaScript FTW!&lt;/h2&gt;&lt;p&gt;Here are a few other MooTools and jQuery tutorials you may like:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/animate-opacity"&gt;Sexy Opacity Animation with MooTools or jQuery&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/google-fade"&gt;Google-Style Element Fading Using MooTools or jQuery&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/iphone-click"&gt;iPhone Click Effect Using MooTools or jQuery&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/text-selection-ajax"&gt;Record Text Selections Using MooTools or jQuery AJAX&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/remove-broken-images"&gt;Remove Broken Images Using MooTools or jQuery&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/jquery-homepage-mootools"&gt;Duplicate the jQuery Homepage Tooltips Using MooTools&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/sugar/jquery"&gt;All jQuery Tutorials&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/sugar/mootools"&gt;All MooTools Tutorials&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href="http://davidwalsh.name/demos"&gt;All MooTools &amp;#038; jQuery Demos&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Isn&amp;#8217;t the javascript community great?  MooTools FTW!&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/jquery-podcast"&gt;jQuery Podcast &amp;#038; Essential jQuery and MooTools&amp;nbsp;Snippets&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/faceoff-show' rel='bookmark' title='Permanent Link: David Walsh on the Faceoff Show&amp;nbsp;Podcast'&gt;David Walsh on the Faceoff Show&amp;nbsp;Podcast&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/5-simple-ways-programmers-and-designers-should-give-back' rel='bookmark' title='Permanent Link: 5 Simple Ways Programmers and Designers Should Give&amp;nbsp;Back'&gt;5 Simple Ways Programmers and Designers Should Give&amp;nbsp;Back&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/color-palette-generator-jquery' rel='bookmark' title='Permanent Link: Color Palette Generator Using&amp;nbsp;jQuery'&gt;Color Palette Generator Using&amp;nbsp;jQuery&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/one-year-anniversary' rel='bookmark' title='Permanent Link: One Year Anniversary&amp;nbsp;Today!'&gt;One Year Anniversary&amp;nbsp;Today!&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/image-protector-plugin-for-jquery' rel='bookmark' title='Permanent Link: dwImageProtector Plugin for&amp;nbsp;jQuery'&gt;dwImageProtector Plugin for&amp;nbsp;jQuery&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/8pC0nq816KM" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/jquery-podcast#comments" thr:count="3" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/jquery-podcast/feed/atom" thr:count="3" /> <thr:total>3</thr:total> <feedburner:origLink>http://davidwalsh.name/jquery-podcast</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[Fixing Python&#8217;s &#8220;Python Eggs&#8221;&#160;Error]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/GuYQ98jaH64/python-eggs" /> <id>http://davidwalsh.name/?p=4879</id> <updated>2010-02-25T14:29:00Z</updated> <published>2010-02-25T14:29:00Z</published> <category scheme="http://davidwalsh.name" term="Shell" /> <summary type="html"><![CDATA[Let me first state this for the record:  I am not a server guy.  The closest I&#8217;ve ever gotten to compiling my own versions of code is &#8220;sudo port install &#8230;&#8221;  So when I decided to teach myself Python (creating simply database interaction, record listings, etc) and kept getting &#8220;500 Internal Server [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/python-eggs">Fixing Python&#8217;s &#8220;Python Eggs&#8221;&nbsp;Error</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/custom-error-handling-php' rel='bookmark' title='Permanent Link: Custom Error Handling in&nbsp;PHP'>Custom Error Handling in&nbsp;PHP</a></li><li><a
href='http://davidwalsh.name/custom-404-page-tips' rel='bookmark' title='Permanent Link: Custom Error Page Tips &#8211; Designate The Pages You Hope No One&nbsp;Sees'>Custom Error Page Tips &#8211; Designate The Pages You Hope No One&nbsp;Sees</a></li><li><a
href='http://davidwalsh.name/php-odbc-nvarchar' rel='bookmark' title='Permanent Link: PHP, ODBC, and&nbsp;nvarchar'>PHP, ODBC, and&nbsp;nvarchar</a></li><li><a
href='http://davidwalsh.name/google-load' rel='bookmark' title='Permanent Link: google.load():  Utilize Google&#8217;s Ajax Libraries&nbsp;API'>google.load():  Utilize Google&#8217;s Ajax Libraries&nbsp;API</a></li><li><a
href='http://davidwalsh.name/prevent-directory-listings-with-htaccess' rel='bookmark' title='Permanent Link: Prevent Directory Listings With&nbsp;.htaccess'>Prevent Directory Listings With&nbsp;.htaccess</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/python-eggs">&lt;p&gt;Let me first state this for the record:  I am not a server guy.  The closest I&amp;#8217;ve ever gotten to compiling my own versions of code is &amp;#8220;sudo port install &amp;#8230;&amp;#8221;  So when I decided to teach myself Python (creating simply database interaction, record listings, etc) and kept getting &amp;#8220;500 Internal Server Error&amp;#8221; messages, I thought I was doomed.  I opened up the Apache error log and saw this:&lt;/p&gt;&lt;pre class="shell"&gt;
[error] [client ::1] Traceback (most recent call last):
[error] [client ::1]   File &amp;quot;/Users/davidwalsh83/Projects/server/something.py&amp;quot;, line 6, in &amp;lt;module&amp;gt;
[error] [client ::1]     import MySQLdb, cgi, cgitb, httplib, urllib2
[error] [client ::1]   File &amp;quot;build/bdist.macosx-10.6-universal/egg/MySQLdb/__init__.py&amp;quot;, line 19, in &amp;lt;module&amp;gt;
[error] [client ::1]   File &amp;quot;build/bdist.macosx-10.6-universal/egg/_mysql.py&amp;quot;, line 7, in &amp;lt;module&amp;gt;
[error] [client ::1]   File &amp;quot;build/bdist.macosx-10.6-universal/egg/_mysql.py&amp;quot;, line 4, in __bootstrap__
[error] [client ::1]   File &amp;quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&amp;quot;, line 835, in resource_filename
[error] [client ::1]     self, resource_name
[error] [client ::1]   File &amp;quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&amp;quot;, line 1304, in get_resource_filename
[error] [client ::1]     self._extract_resource(manager, self._eager_to_zip(name))
[error] [client ::1]   File &amp;quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&amp;quot;, line 1326, in _extract_resource
[error] [client ::1]     self.egg_name, self._parts(zip_path)
[error] [client ::1]   File &amp;quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&amp;quot;, line 915, in get_cache_path
[error] [client ::1]     self.extraction_error()
[error] [client ::1]   File &amp;quot;/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python/pkg_resources.py&amp;quot;, line 881, in extraction_error
[error] [client ::1]     raise err
[error] [client ::1] pkg_resources.ExtractionError: Can't extract file(s) to egg cache
[error] [client ::1] 
[error] [client ::1] The following error occurred while trying to extract file(s) to the Python egg
[error] [client ::1] cache:
[error] [client ::1] 
[error] [client ::1]   [Errno 20] Not a directory: '/Library/WebServer/.python-eggs/MySQL_python-1.2.3c1-py2.6-macosx-10.6-universal.egg-tmp'
[error] [client ::1] 
[error] [client ::1] The Python egg cache directory is currently set to:
[error] [client ::1] 
[error] [client ::1]   /Library/WebServer/.python-eggs
[error] [client ::1] 
[error] [client ::1] Perhaps your account does not have write access to this directory?  You can
[error] [client ::1] change the cache directory by setting the PYTHON_EGG_CACHE environment
[error] [client ::1] variable to point to an accessible directory.
[error] [client ::1] 
[error] [client ::1] Premature end of script headers: something.py
&lt;/pre&gt;&lt;p&gt;My first thought was &amp;#8220;Wow, that&amp;#8217;s quite a long way of telling me to &amp;#8216;just quit.&amp;#8217;&amp;#8221;  Not wanting to concede defeat, I did some quick Google searching to find that the following snippet of Python code would allow me program another day:&lt;/p&gt;&lt;pre class="shell"&gt;
import os
os.environ['PYTHON_EGG_CACHE'] = '/tmp'
&lt;/pre&gt;&lt;p&gt;I&amp;#8217;d like to pretend I know what that means but I really don&amp;#8217;t know.  In any event, if you start receiving those errors, this snippet could be your ticket to taking a bite out of Python.&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/python-eggs"&gt;Fixing Python&amp;#8217;s &amp;#8220;Python Eggs&amp;#8221;&amp;nbsp;Error&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/custom-error-handling-php' rel='bookmark' title='Permanent Link: Custom Error Handling in&amp;nbsp;PHP'&gt;Custom Error Handling in&amp;nbsp;PHP&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/custom-404-page-tips' rel='bookmark' title='Permanent Link: Custom Error Page Tips &amp;#8211; Designate The Pages You Hope No One&amp;nbsp;Sees'&gt;Custom Error Page Tips &amp;#8211; Designate The Pages You Hope No One&amp;nbsp;Sees&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/php-odbc-nvarchar' rel='bookmark' title='Permanent Link: PHP, ODBC, and&amp;nbsp;nvarchar'&gt;PHP, ODBC, and&amp;nbsp;nvarchar&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/google-load' rel='bookmark' title='Permanent Link: google.load():  Utilize Google&amp;#8217;s Ajax Libraries&amp;nbsp;API'&gt;google.load():  Utilize Google&amp;#8217;s Ajax Libraries&amp;nbsp;API&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/prevent-directory-listings-with-htaccess' rel='bookmark' title='Permanent Link: Prevent Directory Listings With&amp;nbsp;.htaccess'&gt;Prevent Directory Listings With&amp;nbsp;.htaccess&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/GuYQ98jaH64" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/python-eggs#comments" thr:count="3" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/python-eggs/feed/atom" thr:count="3" /> <thr:total>3</thr:total> <feedburner:origLink>http://davidwalsh.name/python-eggs</feedburner:origLink></entry> <entry> <author> <name>David Walsh</name> <uri>http://davidwalsh.name</uri> </author><title type="html"><![CDATA[Create a Simple News Scroller Using MooTools, Part I:  The&#160;Basics]]></title><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/Bludice/~3/fQygmKaW00Y/mootools-scroller" /> <id>http://davidwalsh.name/?p=4803</id> <updated>2010-02-23T14:17:25Z</updated> <published>2010-02-23T14:17:25Z</published> <category scheme="http://davidwalsh.name" term="CSS / Design" /><category scheme="http://davidwalsh.name" term="MooTools" /><category scheme="http://davidwalsh.name" term="XML / XHTML" /> <summary type="html"><![CDATA[News scroller have been around forever on the internet.  Why?  Because they&#8217;re usually classy and effective.  Over the next few weeks, we&#8217;ll be taking a simple scroller and making it into a flexible, portable class.  We have to crawl before we walk though;  let&#8217;s make a simple news scroller using [...]<p>Don't forget to <a
href="http://twitter.com/davidwalshblog">follow me on Twitter</a> and be sure to visit <a
href="http://scriptandstyle.com">Script & Style</a> for the best Javascript and CSS articles around!<a
href="http://buysellads.com/buy/detail/1687">Sponsor the David Walsh Blog</a> and get your brand in front of several thousand users per day!<br/><br/><a
href="http://davidwalsh.name/mootools-scroller">Create a Simple News Scroller Using MooTools, Part I:  The&nbsp;Basics</a></p>Related posts:<ol><li><a
href='http://davidwalsh.name/news-scroller-dojo' rel='bookmark' title='Permanent Link: Create a Simple News Scroller Using&nbsp;Dojo'>Create a Simple News Scroller Using&nbsp;Dojo</a></li><li><a
href='http://davidwalsh.name/mootools-font-size-scroller-cookie-save' rel='bookmark' title='Permanent Link: MooTools Font-Size Scroller with Cookie&nbsp;Save'>MooTools Font-Size Scroller with Cookie&nbsp;Save</a></li><li><a
href='http://davidwalsh.name/mootools-slideshow' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using&nbsp;MooTools'>Create a Simple Slideshow Using&nbsp;MooTools</a></li><li><a
href='http://davidwalsh.name/mootools-slideshow-ii' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part II:  Controls and&nbsp;Events'>Create a Simple Slideshow Using MooTools, Part II:  Controls and&nbsp;Events</a></li><li><a
href='http://davidwalsh.name/mootools-drag-drop' rel='bookmark' title='Permanent Link: Using MooTools 1.2 For Drag, Drop, Sort,&nbsp;Save'>Using MooTools 1.2 For Drag, Drop, Sort,&nbsp;Save</a></li></ol>]]></summary> <content type="html" xml:base="http://davidwalsh.name/mootools-scroller">&lt;a
href="http://davidwalsh.name/dw-content/news-scroller.php"&gt;&lt;img
src="http://davidwalsh.name/dw-content/news-scroller-1.jpg" alt="News Scroller" class="image" /&gt;&lt;/a&gt;&lt;p&gt;News scroller have been around forever on the internet.  Why?  Because they&amp;#8217;re usually classy and effective.  Over the next few weeks, we&amp;#8217;ll be taking a simple scroller and making it into a flexible, portable class.  We have to crawl before we walk though;  let&amp;#8217;s make a simple news scroller using MooTools.&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/news-scroller.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;The HTML&lt;/h2&gt;&lt;pre class="html"&gt;
&amp;lt;div id=&amp;quot;news-feed&amp;quot;&amp;gt;
	&amp;lt;ul&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;strong style=&amp;quot;font-size:14px;&amp;quot;&amp;gt;News Item 1&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;Pellentesque habitant morbi...&amp;lt;a href=&amp;quot;#&amp;quot;&amp;gt;Read More&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;li&amp;gt;&amp;lt;strong style=&amp;quot;font-size:14px;&amp;quot;&amp;gt;News Item 2&amp;lt;/strong&amp;gt;&amp;lt;br /&amp;gt;Pellentesque habitant morbi...&amp;lt;a href=&amp;quot;/news/2&amp;quot;&amp;gt;Read More&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
		&amp;lt;!-- more.... --&amp;gt;
	&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;&lt;p&gt;The HTML part is fairly simple: a list with numerous list items (news items) wrapped in a single DIV.&lt;/p&gt;&lt;h2&gt;The CSS&lt;/h2&gt;&lt;pre class="css"&gt;
#news-feed	 { height:200px; width:300px; overflow:hidden; position:relative; border:1px solid #ccc; background:#eee; }
#news-feed ul	{ position:absolute; top:0; left:0; list-style-type:none; padding:0; margin:0; }
#news-feed ul li { height:180px; font-size:12px; margin:0; padding:10px; overflow:hidden; }
&lt;/pre&gt;&lt;p&gt;Getting the CSS correct is very important for our simple scroller.  The wrapper DIV must be positioned relative and the UL must be positioned absolutely.  Each LI&amp;#8217;s height + padding/margin/border must be the same height as the UL itself.&lt;/p&gt;&lt;h2&gt;The MooTools Javascript&lt;/h2&gt;&lt;pre class="js"&gt;
window.addEvent('domready',function() {
	/* settings */
	var list = $('news-feed').getFirst('ul');
	var items = list.getElements('li');
	var showDuration = 3000;
	var scrollDuration = 500;
	var index = 0;
	var height = items[0].getSize().y;
	/* action func */
	var move = function() {
		list.set('tween',{
			duration: scrollDuration,
			onComplete: function() {
				if(index == items.length - 1) {
					index = 0 - 1;
					list.scrollTo(0,0);
				}
			}
		}).tween('top',0 - (++index * height));
	};
	/* go! */
	window.addEvent('load',function() {		
		move.periodical(showDuration);
	});
});
&lt;/pre&gt;&lt;p&gt;The settings will be placed at the top of the code block, as always.  Once the settings are defined, a function is created that scrolls from the current news item to the next news item.  Once the scroller reaches the last news item, it scrolls back to the first one.  Lastly, when the page has loaded, the directive to start the news scroller is given.&lt;/p&gt;&lt;div
class="actions"&gt;&lt;a
href="http://davidwalsh.name/dw-content/news-scroller.php" class="demo"&gt;View Demo&lt;/a&gt;&lt;div
class="clear"&gt;&lt;/div&gt;&lt;/div&gt;&lt;p&gt;Creating a basic scroller is super simple.  Look forward to future posts expanding the capabilities of our scroller, including creating a class and adding events.&lt;/p&gt;&lt;p&gt;Don't forget to &lt;a
href="http://twitter.com/davidwalshblog"&gt;follow me on Twitter&lt;/a&gt; and be sure to visit &lt;a
href="http://scriptandstyle.com"&gt;Script &amp; Style&lt;/a&gt; for the best Javascript and CSS articles around!&lt;a
href="http://buysellads.com/buy/detail/1687"&gt;Sponsor the David Walsh Blog&lt;/a&gt; and get your brand in front of several thousand users per day!&lt;br/&gt;&lt;br/&gt;&lt;a
href="http://davidwalsh.name/mootools-scroller"&gt;Create a Simple News Scroller Using MooTools, Part I:  The&amp;nbsp;Basics&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Related posts:&lt;ol&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/news-scroller-dojo' rel='bookmark' title='Permanent Link: Create a Simple News Scroller Using&amp;nbsp;Dojo'&gt;Create a Simple News Scroller Using&amp;nbsp;Dojo&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-font-size-scroller-cookie-save' rel='bookmark' title='Permanent Link: MooTools Font-Size Scroller with Cookie&amp;nbsp;Save'&gt;MooTools Font-Size Scroller with Cookie&amp;nbsp;Save&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-slideshow' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using&amp;nbsp;MooTools'&gt;Create a Simple Slideshow Using&amp;nbsp;MooTools&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-slideshow-ii' rel='bookmark' title='Permanent Link: Create a Simple Slideshow Using MooTools, Part II:  Controls and&amp;nbsp;Events'&gt;Create a Simple Slideshow Using MooTools, Part II:  Controls and&amp;nbsp;Events&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a
href='http://davidwalsh.name/mootools-drag-drop' rel='bookmark' title='Permanent Link: Using MooTools 1.2 For Drag, Drop, Sort,&amp;nbsp;Save'&gt;Using MooTools 1.2 For Drag, Drop, Sort,&amp;nbsp;Save&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/Bludice/~4/fQygmKaW00Y" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://davidwalsh.name/mootools-scroller#comments" thr:count="16" /><link rel="replies" type="application/atom+xml" href="http://davidwalsh.name/mootools-scroller/feed/atom" thr:count="16" /> <thr:total>16</thr:total> <feedburner:origLink>http://davidwalsh.name/mootools-scroller</feedburner:origLink></entry> </feed><!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 61/168 queries in 0.888 seconds using disk

Served from: davidwalsh.name @ 2010-03-12 04:00:04 -->
