Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,471
There are 809 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     Javascript :

Active Link In Navigation

Thread title: Active Link In Navigation
Closed Thread    
    Thread tools Search this thread Display Modes  
09-03-2008, 10:26 PM
#1
the matt is offline the matt
the matt's Avatar
Status: I love this place
Join date: Mar 2006
Location: San Diego, CA
Expertise:
Software:
 
Posts: 555
iTrader: 13 / 100%
 

the matt is on a distinguished road

Send a message via Skype™ to the matt

  Old  Active Link In Navigation

I am wondering what is the best way to go about having a link stay underlined or styled differently when you are on that current page.

Whats the best way to do this using normal links? how about with an image navigation?

Im assuming it takes some Javascript but anyway would be great, the simpler the better

09-06-2008, 02:03 AM
#2
the matt is offline the matt
the matt's Avatar
Status: I love this place
Join date: Mar 2006
Location: San Diego, CA
Expertise:
Software:
 
Posts: 555
iTrader: 13 / 100%
 

the matt is on a distinguished road

Send a message via Skype™ to the matt

  Old

Does anyone know how to make a "current page" link using javascript? ive googled some but they seem over complicated. I used to know a simple one but I lost he link...

09-06-2008, 02:56 AM
#3
okaymatt is offline okaymatt
Status: Member
Join date: Apr 2007
Location:
Expertise:
Software:
 
Posts: 174
iTrader: 0 / 0%
 

okaymatt is on a distinguished road

  Old

Can you explain a little more what you are trying to do?

09-06-2008, 09:51 AM
#4
the matt is offline the matt
the matt's Avatar
Status: I love this place
Join date: Mar 2006
Location: San Diego, CA
Expertise:
Software:
 
Posts: 555
iTrader: 13 / 100%
 

the matt is on a distinguished road

Send a message via Skype™ to the matt

  Old

Well lets say I have a website.

The navigation has the links Homepage, About Us, and Contact. All the links are Blue and become Orange when you hover over them. But when you click Contact Us and go the that page the link "Contact Us" is Red. When You are on the About Us page, the About link in the nav is Red.

Basically whatever the current page your on, its styled differently in the menu.

09-06-2008, 05:53 PM
#5
okaymatt is offline okaymatt
Status: Member
Join date: Apr 2007
Location:
Expertise:
Software:
 
Posts: 174
iTrader: 0 / 0%
 

okaymatt is on a distinguished road

  Old

Just need to edit the text link ID's in the CSS.

This may be something you are looking for: http://www.elated.com/articles/styling-links-with-css/

09-06-2008, 06:15 PM
#6
the matt is offline the matt
the matt's Avatar
Status: I love this place
Join date: Mar 2006
Location: San Diego, CA
Expertise:
Software:
 
Posts: 555
iTrader: 13 / 100%
 

the matt is on a distinguished road

Send a message via Skype™ to the matt

  Old

Its not exactly what I'm looking for. I don't want active or hover styling. More like a snippet of Javacode that can get what page you are on style it differently in the navigation.

Its actually just like your website http://okaymatt.com/about haha. You see how the About button is highlighted when you are on the abour page, and same for the home.

09-08-2008, 06:55 PM
#7
the matt is offline the matt
the matt's Avatar
Status: I love this place
Join date: Mar 2006
Location: San Diego, CA
Expertise:
Software:
 
Posts: 555
iTrader: 13 / 100%
 

the matt is on a distinguished road

Send a message via Skype™ to the matt

  Old

I found what I was looking for

Here is a link to it http://www.cssnewbie.com/intelligent-navigation/

10-11-2008, 05:00 AM
#8
DDHSBob is offline DDHSBob
DDHSBob's Avatar
Status: Junior Member
Join date: Sep 2008
Location:
Expertise:
Software:
 
Posts: 71
iTrader: 5 / 100%
 

DDHSBob is on a distinguished road

Send a message via AIM to DDHSBob Send a message via MSN to DDHSBob

  Old

Nice find

10-24-2008, 04:59 AM
#9
rochow is offline rochow
rochow's Avatar
Status: Member
Join date: Oct 2006
Location: Australia
Expertise:
Software:
 
Posts: 297
iTrader: 4 / 100%
 

rochow is on a distinguished road

Send a message via MSN to rochow Send a message via Skype™ to rochow

  Old

Why wouldn't you just put class="current" or something similar?

10-24-2008, 07:05 PM
#10
ditch182 is offline ditch182
Status: Junior Member
Join date: Jul 2008
Location: NC
Expertise:
Software:
 
Posts: 70
iTrader: 0 / 0%
 

ditch182 is on a distinguished road

  Old

I've always found the simplest wayis to (like rochow says) use class="current", then style current with CSS. I've even used php to dynamically generate which link should be classed as current.

Closed Thread    


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed