<?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: Jquery Super Tip! Automatically highlight the links/menu of the current page with 1 line of code</title>
	<atom:link href="http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/</link>
	<description></description>
	<lastBuildDate>Sat, 16 Oct 2010 19:43:52 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Fred Riley</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-1765</link>
		<dc:creator>Fred Riley</dc:creator>
		<pubDate>Mon, 23 Aug 2010 12:11:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-1765</guid>
		<description>&lt;p&gt;Thanks, that&#039;s a really handy and very simple bit of code, which works a treat :)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks, that&#8217;s a really handy and very simple bit of code, which works a treat <img src='http://www.cybervaldez.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>]]></content:encoded>
	</item>
	<item>
		<title>By: Cyber Valdez</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-1592</link>
		<dc:creator>Cyber Valdez</dc:creator>
		<pubDate>Fri, 13 Aug 2010 19:50:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-1592</guid>
		<description>&lt;p&gt;Hi Rose, try something like:
$(&quot;#navigation li a[href=\&quot;&quot;+loc+&quot;\&quot;]&quot;).addClass(&quot;selected&quot;).parent().addClass(&quot;expand&quot;);&lt;/p&gt;

&lt;p&gt;(just add as many .parent() you need until you get to the right one)
$(&quot;#navigation li a[href=\&quot;&quot;+loc+&quot;\&quot;]&quot;).addClass(&quot;selected&quot;).parent().parent().addClass(&quot;expand&quot;);&lt;/p&gt;

&lt;p&gt;Hope this helps!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Rose, try something like:
$(&#8220;#navigation li a[href=\""+loc+"\"]&#8220;).addClass(&#8220;selected&#8221;).parent().addClass(&#8220;expand&#8221;);</p>

<p>(just add as many .parent() you need until you get to the right one)
$(&#8220;#navigation li a[href=\""+loc+"\"]&#8220;).addClass(&#8220;selected&#8221;).parent().parent().addClass(&#8220;expand&#8221;);</p>

<p>Hope this helps!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Rose</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-1588</link>
		<dc:creator>Rose</dc:creator>
		<pubDate>Fri, 13 Aug 2010 18:09:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-1588</guid>
		<description>&lt;p&gt;Your script was just what I needed! Thank you.&lt;/p&gt;

&lt;p&gt;I do have a few questions though I hope you can help me with. I&#039;m just learning jquery and can&#039;t seem to figure out how to add to this script so that line items with ul submenus that are active are automatically expanded on my accordion. I have a class called &quot;expand&quot; that I would like added through jquery.&lt;/p&gt;

&lt;p&gt;Here&#039;s an example of my current nav structure:&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;Category 1&lt;/a&gt;
&lt;a href=&quot;#&quot;&gt;Category 2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;Subcategory 1&lt;/a&gt;
&lt;a href=&quot;#&quot; rel=&quot;nofollow&quot;&gt;Sub 2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If an item in ul.submenu is active, I&#039;d like the parent li of the ul to automatically have the &quot;expand&quot; class added to it. Any suggestions you have would be great. Thanks.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Your script was just what I needed! Thank you.</p>

<p>I do have a few questions though I hope you can help me with. I&#8217;m just learning jquery and can&#8217;t seem to figure out how to add to this script so that line items with ul submenus that are active are automatically expanded on my accordion. I have a class called &#8220;expand&#8221; that I would like added through jquery.</p>

<p>Here&#8217;s an example of my current nav structure:</p>

<p>&lt;a href=&#8221;#&#8221; rel=&#8221;nofollow&#8221;&gt;Category 1&lt;/a&gt;
&lt;a href=&#8221;#&#8221;&gt;Category 2&lt;/a&gt;</p>

<p>&lt;a href=&#8221;#&#8221; rel=&#8221;nofollow&#8221;&gt;Subcategory 1&lt;/a&gt;
&lt;a href=&#8221;#&#8221; rel=&#8221;nofollow&#8221;&gt;Sub 2&lt;/a&gt;</p>

<p>If an item in ul.submenu is active, I&#8217;d like the parent li of the ul to automatically have the &#8220;expand&#8221; class added to it. Any suggestions you have would be great. Thanks.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Glennyboy</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-1129</link>
		<dc:creator>Glennyboy</dc:creator>
		<pubDate>Wed, 21 Jul 2010 09:52:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-1129</guid>
		<description>&lt;p&gt;Hi
Would you mind demonstrating that please.
Thanks
Glennyboy&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi
Would you mind demonstrating that please.
Thanks
Glennyboy</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Cyber Valdez</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-1119</link>
		<dc:creator>Cyber Valdez</dc:creator>
		<pubDate>Tue, 20 Jul 2010 18:11:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-1119</guid>
		<description>&lt;p&gt;Hmm the technique should also work with SSI+Rewrites setup, as for your script, you may want to use lastIndexOf(&#039;/&#039;) to omit any extra slashes at the end though.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hmm the technique should also work with SSI+Rewrites setup, as for your script, you may want to use lastIndexOf(&#8216;/&#8217;) to omit any extra slashes at the end though.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Glennyboy</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-1117</link>
		<dc:creator>Glennyboy</dc:creator>
		<pubDate>Tue, 20 Jul 2010 15:10:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-1117</guid>
		<description>&lt;p&gt;Hey, Long time&lt;/p&gt;

&lt;p&gt;Unfortunately I never could get the concept above working on my configuration (ssi + mod-rewrite).&lt;/p&gt;

&lt;p&gt;I have found something in the JQuery docs which tries to get the same result:-&lt;/p&gt;

&lt;p&gt;$(function(){
   var path = location.pathname.substring(1);
   if ( path )
     $(&#039;#nav li a[href$=&quot;&#039; + path + &#039;&quot;]&#039;).attr(&#039;class&#039;, &#039;selected&#039;);
 });&lt;/p&gt;

&lt;p&gt;Unlike your script the problem with this is that it doesn&#039;t strip anything out and takes a very literal link strategy.&lt;/p&gt;

&lt;p&gt;So on my current development site:-&lt;/p&gt;

&lt;p&gt;http://ps.slickmedia.co.uk/&lt;/p&gt;

&lt;p&gt;I get nothing on the straight url, but if I visit:-&lt;/p&gt;

&lt;p&gt;http://ps.slickmedia.co.uk//&lt;/p&gt;

&lt;p&gt;Then all my nav items get the &#039;selected class&#039; as they all start and end with a &#039;/&#039; (e.g. &#039;/&#039;, /&#039;about_us/, &#039;/contact_us/&#039; etc) as per your option 1 above. So currently this script is just searching for a &#039;/&#039; and then applying the class.&lt;/p&gt;

&lt;p&gt;Obviously I don&#039;t want that and I&#039;m thinking that if we can combine this script with yours we may have a solution to my problem of it not applying. And that&#039;s where I&#039;m stuck. Any ideas?&lt;/p&gt;

&lt;p&gt;Glennyboy&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey, Long time</p>

<p>Unfortunately I never could get the concept above working on my configuration (ssi + mod-rewrite).</p>

<p>I have found something in the JQuery docs which tries to get the same result:-</p>

<p>$(function(){
   var path = location.pathname.substring(1);
   if ( path )
     $(&#8216;#nav li a[href$="' + path + '"]&#8216;).attr(&#8216;class&#8217;, &#8216;selected&#8217;);
 });</p>

<p>Unlike your script the problem with this is that it doesn&#8217;t strip anything out and takes a very literal link strategy.</p>

<p>So on my current development site:-</p>

<p><a href="http://ps.slickmedia.co.uk/" rel="nofollow">http://ps.slickmedia.co.uk/</a></p>

<p>I get nothing on the straight url, but if I visit:-</p>

<p><a href="http://ps.slickmedia.co.uk//" rel="nofollow">http://ps.slickmedia.co.uk//</a></p>

<p>Then all my nav items get the &#8216;selected class&#8217; as they all start and end with a &#8216;/&#8217; (e.g. &#8216;/&#8217;, /&#8217;about_us/, &#8216;/contact_us/&#8217; etc) as per your option 1 above. So currently this script is just searching for a &#8216;/&#8217; and then applying the class.</p>

<p>Obviously I don&#8217;t want that and I&#8217;m thinking that if we can combine this script with yours we may have a solution to my problem of it not applying. And that&#8217;s where I&#8217;m stuck. Any ideas?</p>

<p>Glennyboy</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Cyber Valdez</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-311</link>
		<dc:creator>Cyber Valdez</dc:creator>
		<pubDate>Thu, 15 Apr 2010 19:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-311</guid>
		<description>&lt;p&gt;try replacing loc = loc[loc.length - 2] to loc = loc[loc.length - 2] + loc[loc.length - 1]
you should try doing an alert(loc) after that as well so you can see what&#039;s wrong with your url. your url should have the same address as the alerted string.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>try replacing loc = loc[loc.length - 2] to loc = loc[loc.length - 2] + loc[loc.length - 1]
you should try doing an alert(loc) after that as well so you can see what&#8217;s wrong with your url. your url should have the same address as the alerted string.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Glennyboy</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-308</link>
		<dc:creator>Glennyboy</dc:creator>
		<pubDate>Thu, 15 Apr 2010 14:41:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-308</guid>
		<description>&lt;p&gt;Hi 
So far so good... almost!!!
I have this working on my test page here:-http://www.allhomegrown.com/menu/
... but I can&#039;t get it working on my actual menu here:-http://www.allhomegrown.com/product/1/
I think this may be because I&#039;m going a further child level down in the url and perhaps the code needs to reflect this as &#039;/product/id/&#039;
I am using your option 1 and this is my code:-
&lt;!--show active link in menu --&gt;&lt;/p&gt;

&lt;p&gt;$(document).ready(function()
  {
    var loc = window.location.toString().split(&quot;/&quot;)
loc = loc[loc.length - 2]
$(&#039;.CollapsiblePanelRepeat a[href=&quot;/&#039;+loc+&#039;/&quot;]&#039;).addClass(&quot;active&quot;);&lt;/p&gt;

&lt;p&gt;});&lt;/p&gt;

&lt;p&gt;and this is my link:-&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/product//&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any ideas my man?
Glennyboy&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi 
So far so good&#8230; almost!!!
I have this working on my test page here:-http://www.allhomegrown.com/menu/
&#8230; but I can&#8217;t get it working on my actual menu here:-http://www.allhomegrown.com/product/1/
I think this may be because I&#8217;m going a further child level down in the url and perhaps the code needs to reflect this as &#8216;/product/id/&#8217;
I am using your option 1 and this is my code:-
<!--show active link in menu --></p>

<p>$(document).ready(function()
  {
    var loc = window.location.toString().split(&#8220;/&#8221;)
loc = loc[loc.length - 2]
$(&#8216;.CollapsiblePanelRepeat a[href="/'+loc+'/"]&#8216;).addClass(&#8220;active&#8221;);</p>

<p>});</p>

<p>and this is my link:-</p>

<p>&lt;a href=&quot;/product//&#8221;&gt;</p>

<p>Any ideas my man?
Glennyboy</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Glennyboy</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-279</link>
		<dc:creator>Glennyboy</dc:creator>
		<pubDate>Thu, 08 Apr 2010 20:33:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-279</guid>
		<description>&lt;p&gt;Hi
This looks excellent - I&#039;ll give it a whirl and let you know how I got on!
Cheers
Glennyboy&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi
This looks excellent &#8211; I&#8217;ll give it a whirl and let you know how I got on!
Cheers
Glennyboy</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Cyber Valdez</title>
		<link>http://www.cybervaldez.com/jquery-super-tip-automatically-highlight-the-linksmenu-of-the-current-page-with-1-line-of-code/2009/comment-page-1/#comment-278</link>
		<dc:creator>Cyber Valdez</dc:creator>
		<pubDate>Thu, 08 Apr 2010 20:24:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-278</guid>
		<description>&lt;p&gt;hi Glenny, you have 3 options
option 1:&lt;/p&gt;

&lt;blockquote&gt;var loc = window.location.toString().split(&quot;/&quot;)
loc = loc[loc.length - 2]
$(&#039;.CollapsiblePanelRepeat a[href=&quot;/&#039;+loc+&#039;/&quot;]&#039;).addClass(&quot;selected&quot;);&lt;/blockquote&gt;

&lt;p&gt;the format of your urls links should be (note the forward slash at the end.)
&lt;a href=&quot;/menu/&quot; rel=&quot;nofollow&quot;&gt;&lt;/p&gt;

&lt;p&gt;option 2: same as above but no forward slash in your urls&lt;/p&gt;

&lt;blockquote&gt;var loc = window.location.toString().split(&quot;/&quot;)
loc = loc[loc.length - 2]
$(&#039;.CollapsiblePanelRepeat a[href=&quot;/&#039;+loc+&#039;&quot;]&#039;).addClass(&quot;selected&quot;);&lt;/blockquote&gt;

&lt;p&gt;the format of your urls links should be (note the forward slash at the end.)
&lt;a href=&quot;/menu&quot; rel=&quot;nofollow&quot;&gt;&lt;/p&gt;

&lt;p&gt;option 3: Exact addresses.&lt;/p&gt;

&lt;blockquote&gt;var loc = window.location.toString()
$(&#039;.CollapsiblePanelRepeat a[href=&quot;&#039;+loc+&#039;&quot;]&#039;).addClass(&quot;selected&quot;);
&lt;/blockquote&gt;

&lt;p&gt;the format of your urls links should be:
&lt;a href=&quot;http://www.allhomegrown.com/menu/&quot; rel=&quot;nofollow&quot;&gt;
&lt;a href=&quot;http://www.allhomegrown.com/menu/menu.php&quot; rel=&quot;nofollow&quot;&gt;&lt;/p&gt;

&lt;p&gt;p.s: if you plan on copying the codes above, use this link instead. This blog theme seems to be converting the apostrophes and quotes so copy pasting the codes from this blog won&#039;t work. Here&#039;s the raw version:
http://pastebin.com/hBywpeBE&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>hi Glenny, you have 3 options
option 1:</p>

<blockquote>var loc = window.location.toString().split(&#8220;/&#8221;)
loc = loc[loc.length - 2]
$(&#8216;.CollapsiblePanelRepeat a[href="/'+loc+'/"]&#8216;).addClass(&#8220;selected&#8221;);</blockquote>

<p>the format of your urls links should be (note the forward slash at the end.)
&lt;a href=&#8221;/menu/&#8221; rel=&#8221;nofollow&#8221;&gt;</p>

<p>option 2: same as above but no forward slash in your urls</p>

<blockquote>var loc = window.location.toString().split(&#8220;/&#8221;)
loc = loc[loc.length - 2]
$(&#8216;.CollapsiblePanelRepeat a[href="/'+loc+'"]&#8216;).addClass(&#8220;selected&#8221;);</blockquote>

<p>the format of your urls links should be (note the forward slash at the end.)
&lt;a href=&#8221;/menu&#8221; rel=&#8221;nofollow&#8221;&gt;</p>

<p>option 3: Exact addresses.</p>

<blockquote>var loc = window.location.toString()
$(&#8216;.CollapsiblePanelRepeat a[href="'+loc+'"]&#8216;).addClass(&#8220;selected&#8221;);
</blockquote>

<p>the format of your urls links should be:
&lt;a href=&#8221;http://www.allhomegrown.com/menu/&#8221; rel=&#8221;nofollow&#8221;&gt;
&lt;a href=&#8221;http://www.allhomegrown.com/menu/menu.php&#8221; rel=&#8221;nofollow&#8221;&gt;</p>

<p>p.s: if you plan on copying the codes above, use this link instead. This blog theme seems to be converting the apostrophes and quotes so copy pasting the codes from this blog won&#8217;t work. Here&#8217;s the raw version:
<a href="http://pastebin.com/hBywpeBE" rel="nofollow">http://pastebin.com/hBywpeBE</a></p>]]></content:encoded>
	</item>
</channel>
</rss>

