Note that there are some explanatory texts on larger screens.

plurals
  1. POHome link on the menu does not highlight
    primarykey
    data
    text
    <p>My menu shows the active links when clicked on it except for the home link (<a href="http://www.obsia.com" rel="nofollow noreferrer">http://www.obsia.com</a>). It is never highlighted. I tried playing around but I can't seem to figure it out. This is the jquery code I used to highlight the links? </p> <pre><code> $(function(){ var path = location.pathname.substring(1); if ( path ) $('.nav a[href$="' + path + '"]').attr('class', 'active'); }); </code></pre> <p>I also have another menu on the <a href="http://www.obsia.com/products/thassos_wonder/" rel="nofollow noreferrer">products pages</a> where I would like to highlight the parents of the siblings and the our products on the global menu. This is the jquery code for the products menu:</p> <pre><code> $(function() { var pathname = location.pathname; var highlight; //highlight home if(pathname == "") highlight = $('ul#accordion &gt; li:first &gt; a:first'); else { var path = pathname.substring(1); if (path) highlight = $('ul#accordion a[href$="' + path + '"]'); }highlight.attr('class', 'active'); // hide 2nd, 3rd, ... level menus $('ul#accordion ul').hide(); // show child menu on click $('ul#accordion &gt; li &gt; a.product_menu').click(function() { //minor improvement $(this).siblings('ul').toggle("slow"); return false; }); //open to current group (highlighted link) by show all parent ul's $('a.active').parents('ul').show(); $('a.active').parents('h2 a').css({'color':'#ff8833'}); //if you only have a 2 level deep navigation you could //use this instead //$('a.selected').parents("ul").eq(0).show(); </code></pre> <p>}); });</p> <p>I tried adding this:</p> <pre><code> $(this).parents('ul').addClass('active'); </code></pre> <p>but that does not seem to do the trick?</p> <p>Does anybody have a simple way of accomplishing it? Any help would be appreciated from you guys.</p> <p>Kind Regards, G</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload