Jump to content

Help setting link as active.


dauzy

Recommended Posts

Hey guys needs some help here,

 

I'm creating a site in php everything is pretty much done but there's only one thing left to be done.  I need to make a link display as the active link on the page.  Here's an example.

 

Load page....(no links are active or home is active)

 

clink on the contact page in the navigation menu....(that link becomes active and the link button becomes underlined and stays that way until another link is clicked. 

 

I was told that this can be done using javascript, but I have no experience with JS so can someone help me get started on this... Thanks...

 

if code is needed just ask. 

 

thanks,

Dauzy

Link to comment
https://forums.phpfreaks.com/topic/123999-help-setting-link-as-active/
Share on other sites

If you want to have a link set to active but not actually change the page (keep the browser from refreshing), try something like this:

document.getElementById('my-link').onclick = function()
{
  // do any actions here
  return false;
};

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.