<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.3.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: How to Get Anything You Want - part 2</title>
	<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2</link>
	<description>Getting to know the library of choice for unobtrusive JavaScript</description>
	<pubDate>Thu, 28 Aug 2008 23:59:31 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.1</generator>
		<item>
		<title>By: Paul</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-42706</link>
		<dc:creator>Paul</dc:creator>
		<pubDate>Tue, 22 Apr 2008 16:54:30 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-42706</guid>
		<description>Please don’t tell my friends I’m an idiot

If they are true friends they will already know :)</description>
		<content:encoded><![CDATA[<p>Please don’t tell my friends I’m an idiot</p>
<p>If they are true friends they will already know <img src='http://www.learningjquery.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-41452</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Sat, 19 Apr 2008 03:49:13 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-41452</guid>
		<description>Please don't tell my friends I'm an idiot:
&lt;pre&gt;&lt;code&gt;$(".outerDiv").hover(
	function(){ $(this).find(".innerDiv").show(); }, 
	function(){ $(this).find(".innerDiv").hide(); }
);&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Please don&#8217;t tell my friends I&#8217;m an idiot:</p>
<pre><code>$(".outerDiv").hover(
	function(){ $(this).find(".innerDiv").show(); },
	function(){ $(this).find(".innerDiv").hide(); }
);</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-41451</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Sat, 19 Apr 2008 03:43:17 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-41451</guid>
		<description>Oops ... errant comma.  Fix below:
&lt;pre&gt;&lt;code&gt;$(".outerDiv").hover(
  $(this).find('.innerDiv').show(),
  $(this).find('.innerDiv').hide()
);&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Oops &#8230; errant comma.  Fix below:</p>
<pre><code>$(".outerDiv").hover(
  $(this).find('.innerDiv').show(),
  $(this).find('.innerDiv').hide()
);</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-41450</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Sat, 19 Apr 2008 03:37:57 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-41450</guid>
		<description>Thanks a ton for the tutorial!  I was able to solve a problem with a selector that was below the hovered item like:
&lt;pre&gt;&lt;code&gt;$(".outerDiv").hover(
  $(this).find('.innerDiv').show(),
  $(this).find('.innerDiv').hide(),
);&lt;/code&gt;&lt;/pre&gt;This worked incredibly easily to show a div when you hovered.  Basically, it shows an edit link when you hover, and hides it when you lose hover.

Thanks again for a great site!</description>
		<content:encoded><![CDATA[<p>Thanks a ton for the tutorial!  I was able to solve a problem with a selector that was below the hovered item like:</p>
<pre><code>$(".outerDiv").hover(
  $(this).find('.innerDiv').show(),
  $(this).find('.innerDiv').hide(),
);</code></pre>
<p>This worked incredibly easily to show a div when you hovered.  Basically, it shows an edit link when you hover, and hides it when you lose hover.</p>
<p>Thanks again for a great site!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-34046</link>
		<dc:creator>Karl</dc:creator>
		<pubDate>Sun, 16 Mar 2008 23:04:21 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-34046</guid>
		<description>Hi Andy,

Well, if the class is "active", then you'll need to have ...&lt;code&gt;:has(.active)&lt;/code&gt;, but other than that, it looks fine. You probably don't need the first ul, unless you have to distinguish it from an ol. So, all together, it might look like this:
&lt;code&gt;$('#left li ul:has(.active)')&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Hi Andy,</p>
<p>Well, if the class is &#8220;active&#8221;, then you&#8217;ll need to have &#8230;<code>:has(.active)</code>, but other than that, it looks fine. You probably don&#8217;t need the first ul, unless you have to distinguish it from an ol. So, all together, it might look like this:<br />
<code>$('#left li ul:has(.active)')</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-34044</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Sun, 16 Mar 2008 22:19:00 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-34044</guid>
		<description>For previous post:
&lt;pre&gt;&lt;code&gt;
$('#left ul li ul:has(.active_page)')
&lt;/code&gt;&lt;/pre&gt;

Is this correct?</description>
		<content:encoded><![CDATA[<p>For previous post:</p>
<pre><code>
$('#left ul li ul:has(.active_page)')
</code></pre>
<p>Is this correct?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-34043</link>
		<dc:creator>Andy</dc:creator>
		<pubDate>Sun, 16 Mar 2008 22:10:15 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-34043</guid>
		<description>This is great article, thanks, Karl!
I`m newbie in JQuery and ask you to help.
I have this code:
&lt;pre&gt;&lt;code&gt; 
#left
  ul
    li
      ul ----------- how to get it?
        ...
          a class="active"
        ...
      ul
      ul
&lt;/code&gt;&lt;/pre&gt;
The question: how to get &lt;code&gt;#left ul li ul&lt;/code&gt; which have inside&lt;code&gt;&#60;a class="active"&#62;&lt;/code&gt;.
The problem (for me): tag a is on unknown level inside ul</description>
		<content:encoded><![CDATA[<p>This is great article, thanks, Karl!<br />
I`m newbie in JQuery and ask you to help.<br />
I have this code:</p>
<pre><code>
#left
  ul
    li
      ul ----------- how to get it?
        ...
          a class="active"
        ...
      ul
      ul
</code></pre>
<p>The question: how to get <code>#left ul li ul</code> which have inside<code>&lt;a class="active"&gt;</code>.<br />
The problem (for me): tag a is on unknown level inside ul</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: frances</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-28270</link>
		<dc:creator>frances</dc:creator>
		<pubDate>Fri, 25 Jan 2008 15:55:18 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-28270</guid>
		<description>Awesome! It's so simple and yet I was tying myself in knots trying to figure it out. I think I still have to get the hang of jQuery's chaining... Thanks so much for the help and a great example to learn from!</description>
		<content:encoded><![CDATA[<p>Awesome! It&#8217;s so simple and yet I was tying myself in knots trying to figure it out. I think I still have to get the hang of jQuery&#8217;s chaining&#8230; Thanks so much for the help and a great example to learn from!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Karl</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-28168</link>
		<dc:creator>Karl</dc:creator>
		<pubDate>Fri, 25 Jan 2008 03:39:00 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-28168</guid>
		<description>Hi Frances,

I think I know what you're getting at. I think the secret is to make use of the &lt;code&gt;this&lt;/code&gt; keyword. Something like this:

&lt;pre&gt;&lt;code&gt;$('td').hover(function() {
  $('td.' + this.className).addClass('on');
}, function() {
  $('td').removeClass('on');
});&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi Frances,</p>
<p>I think I know what you&#8217;re getting at. I think the secret is to make use of the <code>this</code> keyword. Something like this:</p>
<pre><code>$('td').hover(function() {
  $('td.' + this.className).addClass('on');
}, function() {
  $('td').removeClass('on');
});</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: frances</title>
		<link>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-28133</link>
		<dc:creator>frances</dc:creator>
		<pubDate>Thu, 24 Jan 2008 22:53:48 +0000</pubDate>
		<guid>http://www.learningjquery.com/2006/12/how-to-get-anything-you-want-part-2#comment-28133</guid>
		<description>Thanks for a great site, Karl! I'm just getting into jQuery and I couldn't do it without your tutorials. I think I have the same question as willi above. I'm trying to highlight each column in a table when someone hovers over one of the elements. I've added classes to each of the related ths and tds, and I can get it to work but only if I define the class absolutely, like this: 

&lt;pre&gt;&lt;code&gt;
var $classWord = "dayTue";

var $currentClass = "." + $classWord;

var $selectClass = $("table#eventsWeek").find($currentClass);

$($selectClass).hover(
 	function(){ 
 		$($selectClass).addClass("on");
 	}, 
	function(){ 
		$($selectClass).removeClass("on");
	}	 
 );
&lt;/code&gt;&lt;/pre&gt;

(The highlight is done with the css class "on".) What I need is for it to change as the mouse moves... I can't figure out how to create a variable to hold the class of the element being hovered over, which would then be used to select the other elements with the same class, which I think would be something like this: 

&lt;pre&gt;&lt;code&gt;
var $classWord = ($(this).mouseover(
	function() {
		$(this).attr("class");	
	}
));

var $currentClass = "." + $classWord;


var $selectClass = $("table#eventsWeek").find($currentClass);

$($selectClass).hover(
 	function(){ 
 		$($selectClass).addClass("on");
 	}, 
	function(){ 
		$($selectClass).removeClass("on");
	}	 
 );
&lt;/code&gt;&lt;/pre&gt;

I guess that's the heart of my question: How can you select an attribute of the current element being clicked or hovered over? 

thanks for the help and keep up the great work!
-frances</description>
		<content:encoded><![CDATA[<p>Thanks for a great site, Karl! I&#8217;m just getting into jQuery and I couldn&#8217;t do it without your tutorials. I think I have the same question as willi above. I&#8217;m trying to highlight each column in a table when someone hovers over one of the elements. I&#8217;ve added classes to each of the related ths and tds, and I can get it to work but only if I define the class absolutely, like this: </p>
<pre><code>
var $classWord = "dayTue";

var $currentClass = "." + $classWord;

var $selectClass = $("table#eventsWeek").find($currentClass);

$($selectClass).hover(
 	function(){
 		$($selectClass).addClass("on");
 	},
	function(){
		$($selectClass).removeClass("on");
	}
 );
</code></pre>
<p>(The highlight is done with the css class &#8220;on&#8221;.) What I need is for it to change as the mouse moves&#8230; I can&#8217;t figure out how to create a variable to hold the class of the element being hovered over, which would then be used to select the other elements with the same class, which I think would be something like this: </p>
<pre><code>
var $classWord = ($(this).mouseover(
	function() {
		$(this).attr("class");
	}
));

var $currentClass = "." + $classWord;

var $selectClass = $("table#eventsWeek").find($currentClass);

$($selectClass).hover(
 	function(){
 		$($selectClass).addClass("on");
 	},
	function(){
		$($selectClass).removeClass("on");
	}
 );
</code></pre>
<p>I guess that&#8217;s the heart of my question: How can you select an attribute of the current element being clicked or hovered over? </p>
<p>thanks for the help and keep up the great work!<br />
-frances</p>
]]></content:encoded>
	</item>
</channel>
</rss>
