<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Joh.nson.us &#187; css</title>
	<atom:link href="http://joh.nson.us/archive/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://joh.nson.us</link>
	<description>Tech news and reviews.</description>
	<lastBuildDate>Tue, 23 Sep 2008 05:27:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple Way to Modify Menu Items with jQuery</title>
		<link>http://joh.nson.us/archive/simple-way-to-modify-menu-items-with-jquery/</link>
		<comments>http://joh.nson.us/archive/simple-way-to-modify-menu-items-with-jquery/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 23:57:32 +0000</pubDate>
		<dc:creator>Evan Johnson</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Web Design]]></category>

		<guid isPermaLink="false">http://joh.nson.us/?p=47</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>I came across this <a title="Advanced CSS Menu Trick" href="http://www.3point7designs.com/blog/2007/12/22/advanced-css-menu-trick/">website</a> the other day using some really ingenious css that would change the state of a menu item as you hover over it with the mouse, while also changing the states of all other items in the menu that are not hovered. Pretty interesting. I&#8217;ve been so hooked on jQuery lately that I was curious to see if I could throw something together quickly that accomplished the same feat. It was actually a lot easier than I thought it would be.</p>
<p><code>$(function(){<br />
$("#menu li").hover(function() {<br />
$(this).addClass("hover");<br />
$("#menu li").not(".hover").addClass("nothover");<br />
},function(){<br />
$(this).removeClass("hover");<br />
$("#menu li").not(".hover").removeClass("nothover");<br />
});<br />
});</code></p>
<p>Basically, I made it so that when the list item &#8220;li&#8221; contained in the &#8220;#menu&#8221; container is hovered over with the mouse, a class of &#8220;hover&#8221; is added to that item, while every list item not hovered in that set gets a class of &#8220;nothover&#8221;. Now, once the user&#8217;s mouse exits the list item, it removes both the &#8220;hover&#8221; and &#8220;nothover&#8221; classes. Simple, eh?</p>
<p>From here you could easily make the <abbr title="Cascading Style Sheets">CSS</abbr> markup for each event and state, and duplicate what the previous website did with just <abbr title="Cascading Style Sheets">CSS</abbr>.</p>
<p>Here is an <a title="Example" href="http://joh.nson.us/upload/test_jquery.01.html">example</a>. Right click and &#8217;save as&#8217; to save the source code.</p>
]]></content:encoded>
			<wfw:commentRss>http://joh.nson.us/archive/simple-way-to-modify-menu-items-with-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
