Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery dropdown menu. Page marker not working correctly - or how i want it to
    primarykey
    data
    text
    <p>The navbar doesn't look exactly the same as what i have on my own side since i have background images and such - but the navbar itself works perfectly even though on jsfiddle it looks a little funky. </p> <p>The problem I'm having is that my visual marker for whenever i'm on a page, which cant be seen on jsFiddle very well or at all since i can't click on other pages). I'm able to get the visual marker to work on the specific page that i click but only of that specific click, what i'm trying to achieve is a visual marker of where you are no matter how far deep down you are in the pages (whether ul li a or ul li > ul li a or even ul li > ul li > ul li a). for instance.</p> <p>(need to see Jsfiddle to understand what i'm saying) If i hover over "Web", there is a drop-down. I then proceed to go down to "Web-215" where there is another dropdown where I decide i want to navigate to the "jQuery" page.</p> <p>What is currently happening is : When i click on "jQuery" that that single item is being given an id of 'current'. which changes the look. But it's only doing it to that single item.</p> <p>What I want it to do is this: If i click on just "Web" it will add attribute to just "Web" but if i click on "Web > Web-215" or anything in that folder - then it will highlight Web AND web-215. And also - If i click on 'jQuery' which is a third level li to 'Web-215', then all three will have attribute 'current' selected. and should i pick different paths or links it should follow those rules.</p> <p>I'm not sure where I need to go with it but here is the live example: <a href="http://jsfiddle.net/knvH4/2/" rel="nofollow">http://jsfiddle.net/knvH4/2/</a></p> <p>this is where I think the problem somewhere lays Line 16 in the javascript in the jsfiddle</p> <pre><code>function youAreHere() { var pathName = $(location).attr('pathname'); var curPage = pathName.substring(pathName.lastIndexOf('/') + 1); $('a').each(function () { if ($(this).attr('href') == curPage) { $(this).attr('id', 'current'); } else if (curPage == '') { $('a:first').attr('id', 'current'); } }); //END function </code></pre> <p>what is it that I need to do to make it so that all will be given the attribute of (or id) of 'current' and not just the one.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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