<?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/"
		>
<channel>
	<title>Comments on: Easy Zebra Striping with Prototype</title>
	<atom:link href="http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/feed/" rel="self" type="application/rss+xml" />
	<link>http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/</link>
	<description>Outdated Thoughts</description>
	<lastBuildDate>Thu, 27 May 2010 15:21:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Johan Känngård</title>
		<link>http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/comment-page-1/#comment-737</link>
		<dc:creator>Johan Känngård</dc:creator>
		<pubDate>Tue, 27 Oct 2009 13:44:41 +0000</pubDate>
		<guid isPermaLink="false">http://casedogdesigns.com/wordpress/?p=31#comment-737</guid>
		<description>If you resort the table, you might want to remove the odd class name first:
Event.observe(window,&#039;load&#039;,function(n){
	stripe();
});
function stripe(){
	var odds=$$(&#039;table.stripe tbody tr.odd&#039;);
	if(odds) odds.invoke(&#039;removeClassName&#039;,&#039;odd&#039;);
	var evens=$$(&#039;table.stripe tbody tr:nth-child(odd)&#039;);
	if(evens) evens.invoke(&#039;addClassName&#039;,&#039;odd&#039;);
}</description>
		<content:encoded><![CDATA[<p>If you resort the table, you might want to remove the odd class name first:<br />
Event.observe(window,&#8217;load&#8217;,function(n){<br />
	stripe();<br />
});<br />
function stripe(){<br />
	var odds=$$(&#8216;table.stripe tbody tr.odd&#8217;);<br />
	if(odds) odds.invoke(&#8216;removeClassName&#8217;,'odd&#8217;);<br />
	var evens=$$(&#8216;table.stripe tbody tr:nth-child(odd)&#8217;);<br />
	if(evens) evens.invoke(&#8216;addClassName&#8217;,'odd&#8217;);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wikski</title>
		<link>http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/comment-page-1/#comment-731</link>
		<dc:creator>wikski</dc:creator>
		<pubDate>Wed, 01 Jul 2009 23:28:42 +0000</pubDate>
		<guid isPermaLink="false">http://casedogdesigns.com/wordpress/?p=31#comment-731</guid>
		<description>Zuriel - mate that code is bloody brilliant!

I&#039;ve been looking for something that only utilises every second row as you should only need to apply one class and render the default tr with a style to get the same effect.

legend</description>
		<content:encoded><![CDATA[<p>Zuriel &#8211; mate that code is bloody brilliant!</p>
<p>I&#8217;ve been looking for something that only utilises every second row as you should only need to apply one class and render the default tr with a style to get the same effect.</p>
<p>legend</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zuriel</title>
		<link>http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/comment-page-1/#comment-692</link>
		<dc:creator>Zuriel</dc:creator>
		<pubDate>Tue, 27 Jan 2009 16:25:03 +0000</pubDate>
		<guid isPermaLink="false">http://casedogdesigns.com/wordpress/?p=31#comment-692</guid>
		<description>Below is my favorite syntax. Who says we need jquery? :)

document.observe(&#039;dom:loaded&#039;, function(){
  $$(&#039;table.stripe tr:nth-child(odd)&#039;).invoke(&quot;addClassName&quot;, &quot;oddRow&quot;);
});</description>
		<content:encoded><![CDATA[<p>Below is my favorite syntax. Who says we need jquery? <img src='http://casedogdesigns.com/wordpress/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>document.observe(&#8216;dom:loaded&#8217;, function(){<br />
  $$(&#8216;table.stripe tr:nth-child(odd)&#8217;).invoke(&#8220;addClassName&#8221;, &#8220;oddRow&#8221;);<br />
});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andruu</title>
		<link>http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/comment-page-1/#comment-677</link>
		<dc:creator>Andruu</dc:creator>
		<pubDate>Fri, 05 Sep 2008 13:05:53 +0000</pubDate>
		<guid isPermaLink="false">http://casedogdesigns.com/wordpress/?p=31#comment-677</guid>
		<description>The equivalent in Prototype is:

document.observe(&#039;dom:loaded&#039;, function () {});</description>
		<content:encoded><![CDATA[<p>The equivalent in Prototype is:</p>
<p>document.observe(&#8216;dom:loaded&#8217;, function () {});</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tanny O'Haley</title>
		<link>http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/comment-page-1/#comment-664</link>
		<dc:creator>Tanny O'Haley</dc:creator>
		<pubDate>Wed, 23 Jul 2008 07:43:05 +0000</pubDate>
		<guid isPermaLink="false">http://casedogdesigns.com/wordpress/?p=31#comment-664</guid>
		<description>@watsoncj, It is a bit of a hack and I have a smaller version for prototype and other frameworks that don&#039;t support domready. Unfortunately the only way to support as many browser as I can, I have to use &quot;browser specific Javascript&quot;.

&lt;a href=&quot;http://tanny.ica.com/ica/tko/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-v&quot; rel=&quot;nofollow&quot;&gt;DOMContentLoaded for Browsers, Part V&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>@watsoncj, It is a bit of a hack and I have a smaller version for prototype and other frameworks that don&#8217;t support domready. Unfortunately the only way to support as many browser as I can, I have to use &#8220;browser specific Javascript&#8221;.</p>
<p><a href="http://tanny.ica.com/ica/tko/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-v" rel="nofollow">DOMContentLoaded for Browsers, Part V</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: watsoncj</title>
		<link>http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/comment-page-1/#comment-661</link>
		<dc:creator>watsoncj</dc:creator>
		<pubDate>Tue, 15 Jul 2008 22:01:29 +0000</pubDate>
		<guid isPermaLink="false">http://casedogdesigns.com/wordpress/?p=31#comment-661</guid>
		<description>Thanks Eric,

While it may run a bit after the DOM is ready (especially on larger pages), the Event.observe() does just that. It will invoke the stripe function when the window&#039;s onload event fires.

It doesn&#039;t look like prototype has an equivalent DOMLoaded event. The link below has a very convoluted example of achieving the same thing. But, it&#039;s a bit of a hack with its browser specific Javascript.

http://tanny.ica.com/ica/tko/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-ii</description>
		<content:encoded><![CDATA[<p>Thanks Eric,</p>
<p>While it may run a bit after the DOM is ready (especially on larger pages), the Event.observe() does just that. It will invoke the stripe function when the window&#8217;s onload event fires.</p>
<p>It doesn&#8217;t look like prototype has an equivalent DOMLoaded event. The link below has a very convoluted example of achieving the same thing. But, it&#8217;s a bit of a hack with its browser specific Javascript.</p>
<p><a href="http://tanny.ica.com/ica/tko/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-ii" rel="nofollow">http://tanny.ica.com/ica/tko/tkoblog.nsf/dx/domcontentloaded-for-browsers-part-ii</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric Wendelin</title>
		<link>http://casedogdesigns.com/wordpress/easy-zebra-striping-with-prototype/comment-page-1/#comment-660</link>
		<dc:creator>Eric Wendelin</dc:creator>
		<pubDate>Tue, 15 Jul 2008 21:44:32 +0000</pubDate>
		<guid isPermaLink="false">http://casedogdesigns.com/wordpress/?p=31#comment-660</guid>
		<description>I like your method (especially the tr:nth-child(odd) part of $$). Only thing I would suggest is running stripe on DOMReady. Does prototype have a way to attach an event to DOMReady?

Nice example!</description>
		<content:encoded><![CDATA[<p>I like your method (especially the tr:nth-child(odd) part of $$). Only thing I would suggest is running stripe on DOMReady. Does prototype have a way to attach an event to DOMReady?</p>
<p>Nice example!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
