PDA

View Full Version : Navigation Bar Problem



shane_wilson_torrie
10-29-2007, 02:31 PM
How do I code in javascript for the oncilck event for buttons on a navigation bar so the button appears clicked (when clicked)? I created a navigation bar in fireworks with 3 states (up, onmouseover and onclick). I have all the images for the onmouse over and onclick and have imported the navigation bar into Dreamweaver. The onmouseover works but the onclick does not. So when the button is clicked and goes to the next webpage (coldfusion), the navigation bar appears in the upstate for all the buttons. I need to the button to be in the downstate (the one they clicked).

Really looking forward to replies

boogyman
10-29-2007, 02:41 PM
1) there is a separate forum for javascript read the Posting Policy (http://www.dynamicdrive.com/forums/showthread.php?t=24866) especially #2

MOD PLEASE MOVE THIS THREAD

2) the onclick is like following the link, if you wish to override the onclick then you need to void the follow, however you need the think about accessibility because people without javascript enabled (disabled it, dont support it) will return to the default settings of that element, in this case you are using an anchor tag.


<a href="url" onclick="something; return false" onmouseover="something else" onmouseout="yet something else">Link</a>


3) making the link appear in the down state is tricky with just javascript. if you have a server-side code it would be much easier to assign the link to be selected.

please remember to read the and post the url to the problematic code / if not live post the code encapsulated in [code] tags