Jump to content

Highlight a Link After It's Been Clicked?


Dan_Mason

Recommended Posts

Hello :)

 

I have used some Javascript to be able to switch between 3 generated graphs on a page. I wanted to do this so that the page didnt have to be refreshed every time a new graph was selected. All it is basically doing is switching between pictures, Here is a screenshot:

 

Switchgraphpics.jpg

 

All I really want to do is leave the last Hyperlink clicked highlighted, so that it is really obvious to the user which graph they are viewing!

 

Any help would be much appreciated! :D

Link to comment
Share on other sites

You might run into some cross browser issues depending how you reference your html properties in javascript but that said the first thing I would think to do is use the OnClick function to call a function that applies highlighting to whatever html element was just clicked.  The trick is un-highlighting a value once another is clicked - one way to do this would be to remember which one was last clicked, and set it back to normal when the next is clicked, since you're dealing with only 3 values it would be simpler to just say that the items that don't get clicked, all get set back to normal, the one that did get clicked gets set to highlighted by your custom php function.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.