<?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: Simple Jquery and CSS menu</title>
	<atom:link href="http://johnmccollum.co.uk/2008/07/13/simple-jquery-and-css-menu/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnmccollum.co.uk/2008/07/13/simple-jquery-and-css-menu/</link>
	<description>Thoughts on web development, social media, the internet, and computers in general.</description>
	<pubDate>Tue, 06 Jan 2009 00:33:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: redsquare</title>
		<link>http://johnmccollum.co.uk/2008/07/13/simple-jquery-and-css-menu/comment-page-1/#comment-45</link>
		<dc:creator>redsquare</dc:creator>
		<pubDate>Sun, 13 Jul 2008 19:08:06 +0000</pubDate>
		<guid isPermaLink="false">http://johnmccollum.co.uk/?p=18#comment-45</guid>
		<description>No probs, any issues come join us at #jquery irc channel on freenode</description>
		<content:encoded><![CDATA[<p>No probs, any issues come join us at #jquery irc channel on freenode</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://johnmccollum.co.uk/2008/07/13/simple-jquery-and-css-menu/comment-page-1/#comment-44</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Sun, 13 Jul 2008 18:11:29 +0000</pubDate>
		<guid isPermaLink="false">http://johnmccollum.co.uk/?p=18#comment-44</guid>
		<description>Hi Redsquare,

Thanks for your comment! For some reason I never think to use the ternary operator - good tip. I'll also check out the toggle() function. Still got quite a bit of reading to do to be completely up to speed on Jquery, but I'm loving the experience so far!

Cheers,
John</description>
		<content:encoded><![CDATA[<p>Hi Redsquare,</p>
<p>Thanks for your comment! For some reason I never think to use the ternary operator - good tip. I&#8217;ll also check out the toggle() function. Still got quite a bit of reading to do to be completely up to speed on Jquery, but I&#8217;m loving the experience so far!</p>
<p>Cheers,<br />
John</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: redsquare</title>
		<link>http://johnmccollum.co.uk/2008/07/13/simple-jquery-and-css-menu/comment-page-1/#comment-43</link>
		<dc:creator>redsquare</dc:creator>
		<pubDate>Sun, 13 Jul 2008 15:19:48 +0000</pubDate>
		<guid isPermaLink="false">http://johnmccollum.co.uk/?p=18#comment-43</guid>
		<description>Hi Mate,
Welcome to jq. I noticed in your code that you repeated the selector.

The following snippet
if($(”li:not(:first)”).is(”:visible”)){
$(”li:not(:first)”).fadeOut(”fast”);
}else{
$(”li:not(:first)”).fadeIn(”fast”);
}
would read better as

var listItems = $(”li:not(:first)”);
listItems.is(”:visible”) ? listItems.fadeOut(”fast”) : listItems.fadeIn(”fast”);

small improvement but good for performance and readability

However even better would be to make use of the toggle() function

so you can say

$(”li.starter”).toggle( 
   function(){
     $(”li:not(:first)”).fadeIn(”fast”);
   },
   function(){
     $(”li:not(:first)”).fadeOut(”fast”);
   }
);

Now each click will toggle between the two given functions.

Happy jqueing</description>
		<content:encoded><![CDATA[<p>Hi Mate,<br />
Welcome to jq. I noticed in your code that you repeated the selector.</p>
<p>The following snippet<br />
if($(”li:not(:first)”).is(”:visible”)){<br />
$(”li:not(:first)”).fadeOut(”fast”);<br />
}else{<br />
$(”li:not(:first)”).fadeIn(”fast”);<br />
}<br />
would read better as</p>
<p>var listItems = $(”li:not(:first)”);<br />
listItems.is(”:visible”) ? listItems.fadeOut(”fast”) : listItems.fadeIn(”fast”);</p>
<p>small improvement but good for performance and readability</p>
<p>However even better would be to make use of the toggle() function</p>
<p>so you can say</p>
<p>$(”li.starter”).toggle(<br />
   function(){<br />
     $(”li:not(:first)”).fadeIn(”fast”);<br />
   },<br />
   function(){<br />
     $(”li:not(:first)”).fadeOut(”fast”);<br />
   }<br />
);</p>
<p>Now each click will toggle between the two given functions.</p>
<p>Happy jqueing</p>
]]></content:encoded>
	</item>
</channel>
</rss>
