|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Maintain button "on" state..
Hi, I am trying to keep the navigation button to the "on" state when user clicks on one of the two buttons. (The html page loads when the button is clicked but the button should still be in the "on" state) I think I need a Javascript function to do that, but not sure how. Here is my html codes:
<html> <head> <table cellspacing=0 cellpadding=0 border=0> <tr> <td><a href="popup_content.html" onMouseOver="document.images['nav1'].src = 'med/main_on.gif';" onMouseOut=" document.images['nav1'].src = 'med/main_off.gif';"><img src="med/main_off.gif" width=33 height=25 border=0 alt="" name=nav1></a></td> <td><a href="#" onMouseOver="document.images['nav2'].src = 'med/orderonline_on.gif';" onMouseOut="document.images['nav2'].src = 'med/orderonline_off.gif';"><img src="med/orderonline_off.gif" width=82 height=25 border=0 alt="" name=nav2></a></td> </tr> </table> </body> </html> |
|
#2
|
||||
|
||||
|
You need more than a javascript to remember a state if the page is replaced by clicking a link. You need a cookie.
|
|
#3
|
|||
|
|||
|
Sorry for the confusion, the page it loads is on the same page but inside a different frame.
|
|
#4
|
||||
|
||||
|
Code:
<script> var click1 = false; </script> ... <a ... onmouseout="if(!click1)document.images['nav1'].src='med/main_off.gif'" onclick="click1=true"> ... |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|