<?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>Thu, 29 Jul 2010 22:11:39 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<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>Hi
Would you mind demonstrating that please.
Thanks
Glennyboy</description>
		<content:encoded><![CDATA[<p>Hi<br />
Would you mind demonstrating that please.<br />
Thanks<br />
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>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.</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(&#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>Hey, Long time

Unfortunately I never could get the concept above working on my configuration (ssi + mod-rewrite).

I have found something in the JQuery docs which tries to get the same result:-


$(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;);
 });


Unlike your script the problem with this is that it doesn&#039;t strip anything out and takes a very literal link strategy.

So on my current development site:-

http://ps.slickmedia.co.uk/

I get nothing on the straight url, but if I visit:-

http://ps.slickmedia.co.uk//

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.

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?

Glennyboy</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(){<br />
   var path = location.pathname.substring(1);<br />
   if ( path )<br />
     $(&#8217;#nav li a[href$="' + path + '"]&#8216;).attr(&#8217;class&#8217;, &#8217;selected&#8217;);<br />
 });</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 &#8217;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>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.</description>
		<content:encoded><![CDATA[<p>try replacing loc = loc[loc.length - 2] to loc = loc[loc.length - 2] + loc[loc.length - 1]<br />
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>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;

$(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;);
	
  });

and this is my link:-

      
&lt;a href=&quot;/product//&quot;&gt;&lt;/a&gt;


Any ideas my man?
Glennyboy</description>
		<content:encoded><![CDATA[<p>Hi<br />
So far so good&#8230; almost!!!<br />
I have this working on my test page here:-http://www.allhomegrown.com/menu/<br />
&#8230; but I can&#8217;t get it working on my actual menu here:-http://www.allhomegrown.com/product/1/<br />
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;<br />
I am using your option 1 and this is my code:-<br />
<!--show active link in menu --></p>
<p>$(document).ready(function()<br />
  {<br />
    var loc = window.location.toString().split(&#8221;/&#8221;)<br />
loc = loc[loc.length - 2]<br />
$(&#8217;.CollapsiblePanelRepeat a[href="/'+loc+'/"]&#8216;).addClass(&#8221;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?<br />
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>Hi
This looks excellent - I&#039;ll give it a whirl and let you know how I got on!
Cheers
Glennyboy</description>
		<content:encoded><![CDATA[<p>Hi<br />
This looks excellent &#8211; I&#8217;ll give it a whirl and let you know how I got on!<br />
Cheers<br />
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>hi Glenny, you have 3 options
option 1:


&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;

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;

option 2: same as above but no forward slash in your urls
&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;

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;

option 3: Exact addresses.
&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;
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;

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
</description>
		<content:encoded><![CDATA[<p>hi Glenny, you have 3 options<br />
option 1:</p>
<blockquote><p>var loc = window.location.toString().split(&#8221;/&#8221;)<br />
loc = loc[loc.length - 2]<br />
$(&#8217;.CollapsiblePanelRepeat a[href="/'+loc+'/"]&#8216;).addClass(&#8221;selected&#8221;);</p></blockquote>
<p>the format of your urls links should be (note the forward slash at the end.)<br />
&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><p>var loc = window.location.toString().split(&#8221;/&#8221;)<br />
loc = loc[loc.length - 2]<br />
$(&#8217;.CollapsiblePanelRepeat a[href="/'+loc+'"]&#8216;).addClass(&#8221;selected&#8221;);</p></blockquote>
<p>the format of your urls links should be (note the forward slash at the end.)<br />
&lt;a href=&#8221;/menu&#8221; rel=&#8221;nofollow&#8221;&gt;</p>
<p>option 3: Exact addresses.</p>
<blockquote><p>var loc = window.location.toString()<br />
$(&#8217;.CollapsiblePanelRepeat a[href="'+loc+'"]&#8216;).addClass(&#8221;selected&#8221;);
</p></blockquote>
<p>the format of your urls links should be:<br />
&lt;a href=&#8221;http://www.allhomegrown.com/menu/&#8221; rel=&#8221;nofollow&#8221;&gt;<br />
&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:<br />
<a href="http://pastebin.com/hBywpeBE" rel="nofollow">http://pastebin.com/hBywpeBE</a></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-277</link>
		<dc:creator>Glennyboy</dc:creator>
		<pubDate>Thu, 08 Apr 2010 18:46:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-277</guid>
		<description>Hi Again

Great so far, but any ideas how this will work after mod-rewrite anyone:-

http://www.allhomegrown.com/menu/

Second link down &#039;Menu Mod Rewrite&#039; should show as current acive in &#039;red&#039;.

Cheers

Glennyboy</description>
		<content:encoded><![CDATA[<p>Hi Again</p>
<p>Great so far, but any ideas how this will work after mod-rewrite anyone:-</p>
<p><a href="http://www.allhomegrown.com/menu/" rel="nofollow">http://www.allhomegrown.com/menu/</a></p>
<p>Second link down &#8216;Menu Mod Rewrite&#8217; should show as current acive in &#8216;red&#8217;.</p>
<p>Cheers</p>
<p>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-269</link>
		<dc:creator>Glennyboy</dc:creator>
		<pubDate>Wed, 07 Apr 2010 10:24:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-269</guid>
		<description>Hi 
Thanks for the quick input... not sure what you mean by &#039;alert(lo), but removing the leading &#039;/&#039; indeed did work. 

Ultimately though I need this to work under a mod-rewrite and I need to use absolute links with the leading /. How can I achieve this as per:-

http://www.allhomegrown.com/menu/

With rewritten link as second line down and being &lt;a href=&quot;/menu/&quot; rel=&quot;nofollow&quot;&gt;Menu Mod Rewrite&lt;/a&gt;

Any ideas?

Glennyboy</description>
		<content:encoded><![CDATA[<p>Hi<br />
Thanks for the quick input&#8230; not sure what you mean by &#8216;alert(lo), but removing the leading &#8216;/&#8217; indeed did work. </p>
<p>Ultimately though I need this to work under a mod-rewrite and I need to use absolute links with the leading /. How can I achieve this as per:-</p>
<p><a href="http://www.allhomegrown.com/menu/" rel="nofollow">http://www.allhomegrown.com/menu/</a></p>
<p>With rewritten link as second line down and being <a href="/menu/" rel="nofollow">Menu Mod Rewrite</a></p>
<p>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-267</link>
		<dc:creator>Cyber Valdez</dc:creator>
		<pubDate>Tue, 06 Apr 2010 16:24:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.cybervaldez.com/?p=1130#comment-267</guid>
		<description>Hi Glenn, try doing an alert(loc) at the end of the $(document).ready() script, your url&#039;s href must match the same text for it to work. You should be able to fix your problems by removing the forward slash in your links&#039; hrefs. Hope that helps!</description>
		<content:encoded><![CDATA[<p>Hi Glenn, try doing an alert(loc) at the end of the $(document).ready() script, your url&#8217;s href must match the same text for it to work. You should be able to fix your problems by removing the forward slash in your links&#8217; hrefs. Hope that helps!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
