Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thinkpatience

macrumors member
Original poster
Jun 28, 2009
55
0
Hi all,

I've designed a single page website with smooth scroll jquery, the header + nav is fixed to the top of the website with anchor tags as the link. So the page travels up underneath the #header with a z-index:9999 set.

Everything functions great, I just need to know how to make the navigation links look a certain way (i.e. line underneath, different color, etc...) when you are on its corresponding page and/or at their anchor tag.

Can this be accomplished through CSS or do I need to use JQuery? Hopefully it's just a simple CSS solution that I'm blanking on...

Thanks!
 
Try

a:active {
color: xxxxxx;
text-decoration: underline;
}

Is this what you need?

Hmm, tried it... it just makes the link underlined when it is clicked until you release the mouse. I'd like it to stay while on that page/anchor.
 
Hi all,

I've designed a single page website with smooth scroll jquery, the header + nav is fixed to the top of the website with anchor tags as the link. So the page travels up underneath the #header with a z-index:9999 set.

Everything functions great, I just need to know how to make the navigation links look a certain way (i.e. line underneath, different color, etc...) when you are on its corresponding page and/or at their anchor tag.

Can this be accomplished through CSS or do I need to use JQuery? Hopefully it's just a simple CSS solution that I'm blanking on...

Thanks!

Did you see this thread? It seems it's the same question.

https://forums.macrumors.com/threads/1394686/
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.