<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:series="http://unfoldingneurons.com/"
> <channel><title>Comments on: Link Nudging Using&#160;Dojo</title> <atom:link href="http://davidwalsh.name/link-nudging-dojo/feed" rel="self" type="application/rss+xml" /><link>http://davidwalsh.name/link-nudging-dojo</link> <description>Legendary scribbles about JavaScript, HTML5, AJAX, PHP, CSS, and ∞.</description> <lastBuildDate>Wed, 23 May 2012 04:02:29 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.2</generator> <item><title>By: Sid Burn</title><link>http://davidwalsh.name/link-nudging-dojo#comment-16352</link> <dc:creator>Sid Burn</dc:creator> <pubDate>Fri, 05 Mar 2010 14:26:55 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4909#comment-16352</guid> <description>Ah &quot;nude&quot; oder &quot;nudge&quot; for a non-native english speaker it is almost the same. ;)</description> <content:encoded><![CDATA[<p>Ah &#8220;nude&#8221; oder &#8220;nudge&#8221; for a non-native english speaker it is almost the same. ;)</p> ]]></content:encoded> </item> <item><title>By: David Walsh</title><link>http://davidwalsh.name/link-nudging-dojo#comment-16351</link> <dc:creator>David Walsh</dc:creator> <pubDate>Fri, 05 Mar 2010 14:11:19 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4909#comment-16351</guid> <description>@Sid Burn:  Thanks for the tip Sid.  By the way, I&#039;ve never given a link the &quot;nude&quot; tag before.  :)</description> <content:encoded><![CDATA[<p>@Sid Burn:  Thanks for the tip Sid.  By the way, I&#8217;ve never given a link the &#8220;nude&#8221; tag before.  :)</p> ]]></content:encoded> </item> <item><title>By: Sid Burn</title><link>http://davidwalsh.name/link-nudging-dojo#comment-16350</link> <dc:creator>Sid Burn</dc:creator> <pubDate>Fri, 05 Mar 2010 13:40:17 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4909#comment-16350</guid> <description>Do you just limiting to Dojo Base? In Dojo Core there is &quot;dojo.behavior&quot; that has some additional functionality.
http://www.dojotoolkit.org/api/dojo/behavior.htmlWith dojo.behavior you can write your code like this:dojo.require(&quot;dojo.behavior&quot;);
dojo.ready(function(){
dojo.behavior.add({
&#039;a.nude&#039;: {
&#039;onmouseenter&#039;: function(evt) {
dojo.anim(evt.target, { paddingLeft:20 });
},
&#039;onmouseleave&#039;: function(evt) {
dojo.anim(evt.target, { paddingLeft:left });
}
}
});
dojo.behavior.apply();
});The good part on dojo.behavior is that you can call dojo.behavior.apply() as often as you like. It only updates your DOM incremental. Meaning it only adds the events to newly created DOM nodes, or only add things to a node that you added after the last call to dojo.behavior.apply().That means you can do some ajax add nodes to your DOM, and call &quot;dojo.behavior.apply()&quot; after it. And the new nodes get your defined behavior.</description> <content:encoded><![CDATA[<p>Do you just limiting to Dojo Base? In Dojo Core there is &#8220;dojo.behavior&#8221; that has some additional functionality.<br
/> <a
href="http://www.dojotoolkit.org/api/dojo/behavior.html" rel="nofollow">http://www.dojotoolkit.org/api/dojo/behavior.html</a></p><p>With dojo.behavior you can write your code like this:</p><p>dojo.require(&#8220;dojo.behavior&#8221;);<br
/> dojo.ready(function(){<br
/> dojo.behavior.add({<br
/> &#8216;a.nude&#8217;: {<br
/> &#8216;onmouseenter&#8217;: function(evt) {<br
/> dojo.anim(evt.target, { paddingLeft:20 });<br
/> },<br
/> &#8216;onmouseleave&#8217;: function(evt) {<br
/> dojo.anim(evt.target, { paddingLeft:left });<br
/> }<br
/> }<br
/> });<br
/> dojo.behavior.apply();<br
/> });</p><p>The good part on dojo.behavior is that you can call dojo.behavior.apply() as often as you like. It only updates your DOM incremental. Meaning it only adds the events to newly created DOM nodes, or only add things to a node that you added after the last call to dojo.behavior.apply().</p><p>That means you can do some ajax add nodes to your DOM, and call &#8220;dojo.behavior.apply()&#8221; after it. And the new nodes get your defined behavior.</p> ]]></content:encoded> </item> <item><title>By: David Walsh</title><link>http://davidwalsh.name/link-nudging-dojo#comment-16316</link> <dc:creator>David Walsh</dc:creator> <pubDate>Tue, 02 Mar 2010 23:10:31 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4909#comment-16316</guid> <description>@Brad Pritchard:  Much better -- I&#039;ll update the post!</description> <content:encoded><![CDATA[<p>@Brad Pritchard:  Much better &#8212; I&#8217;ll update the post!</p> ]]></content:encoded> </item> <item><title>By: Brad Pritchard</title><link>http://davidwalsh.name/link-nudging-dojo#comment-16313</link> <dc:creator>Brad Pritchard</dc:creator> <pubDate>Tue, 02 Mar 2010 20:21:19 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4909#comment-16313</guid> <description>Nice one.  One note/question - if your anchors needed a default padding-left of 15px, then the effect would be muted a bit.  Rather than setting padding-left to a static 20, what about changing line 5 to a relative 20?&lt;code&gt;
dojo.anim(link, { paddingLeft: (left + 20) });
&lt;/code&gt;</description> <content:encoded><![CDATA[<p>Nice one.  One note/question &#8211; if your anchors needed a default padding-left of 15px, then the effect would be muted a bit.  Rather than setting padding-left to a static 20, what about changing line 5 to a relative 20?</p><p><code><br
/> dojo.anim(link, { paddingLeft: (left + 20) });<br
/> </code></p> ]]></content:encoded> </item> <item><title>By: Jack Franklin</title><link>http://davidwalsh.name/link-nudging-dojo#comment-16312</link> <dc:creator>Jack Franklin</dc:creator> <pubDate>Tue, 02 Mar 2010 19:41:57 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4909#comment-16312</guid> <description>Hi Rafael / David@Rafael F P Viana:  You can use jQuery&#039;s bind method which is the same as MooTool&#039;s addEvent essentially.Good post David, I actually really like Dojo&#039;s layout so I might investigate. However, it&#039;s clear that MT/jQ are the top two so I think I&#039;m concentrating my skill on those two.</description> <content:encoded><![CDATA[<p>Hi Rafael / David</p><p>@Rafael F P Viana:  You can use jQuery&#8217;s bind method which is the same as MooTool&#8217;s addEvent essentially.</p><p>Good post David, I actually really like Dojo&#8217;s layout so I might investigate. However, it&#8217;s clear that MT/jQ are the top two so I think I&#8217;m concentrating my skill on those two.</p> ]]></content:encoded> </item> <item><title>By: Rafael F P Viana</title><link>http://davidwalsh.name/link-nudging-dojo#comment-16302</link> <dc:creator>Rafael F P Viana</dc:creator> <pubDate>Tue, 02 Mar 2010 00:24:28 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4909#comment-16302</guid> <description>Couldn&#039;t agree more on what you said: &quot;The best way to learn to use any javascript framework is to duplicate a given set of code you are familiar with&quot;By the way, I think the Mootools code is more semantic than the rest, I mean, with jQuery one has to know that .hover is an event, unlike Mootools which says .addEvent.I liked Dojo&#039;s aproch, but the .connect is new to me, but just by reading it I understood that it will connect link to the event and the function.Very nice example and keep up the good work.</description> <content:encoded><![CDATA[<p>Couldn&#8217;t agree more on what you said: &#8220;The best way to learn to use any javascript framework is to duplicate a given set of code you are familiar with&#8221;</p><p>By the way, I think the Mootools code is more semantic than the rest, I mean, with jQuery one has to know that .hover is an event, unlike Mootools which says .addEvent.</p><p>I liked Dojo&#8217;s aproch, but the .connect is new to me, but just by reading it I understood that it will connect link to the event and the function.</p><p>Very nice example and keep up the good work.</p> ]]></content:encoded> </item> <item><title>By: Pete Higgins</title><link>http://davidwalsh.name/link-nudging-dojo#comment-16294</link> <dc:creator>Pete Higgins</dc:creator> <pubDate>Mon, 01 Mar 2010 14:38:46 +0000</pubDate> <guid
isPermaLink="false">http://davidwalsh.name/?p=4909#comment-16294</guid> <description>The mouseenter/mouseleave thing is so common it is actually combined as an API in plugd (soon to be in Dojo proper). With plugd, the Dojo code could look like:&lt;code&gt;$.ready(function() {
$(&#039;a.nudge&#039;).forEach(function(link){
var $link = $(link), left = $link.style(&#039;paddingLeft&#039;);
$link.hover(function(e){
$link.anim({ paddingLeft: /enter&#124;over/.test(e.type) ? 20 : left})
})
});
});&lt;/code&gt;</description> <content:encoded><![CDATA[<p>The mouseenter/mouseleave thing is so common it is actually combined as an API in plugd (soon to be in Dojo proper). With plugd, the Dojo code could look like:</p><p><code>$.ready(function() {<br
/> $('a.nudge').forEach(function(link){<br
/> var $link = $(link), left = $link.style('paddingLeft');<br
/> $link.hover(function(e){<br
/> $link.anim({ paddingLeft: /enter|over/.test(e.type) ? 20 : left})<br
/> })<br
/> });<br
/> });</code></p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 3/8 queries in 0.007 seconds using disk: basic
Object Caching 688/689 objects using disk: basic

Served from: davidwalsh.name @ 2012-05-23 05:24:10 -->
