www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Client-Side Development > JavaScript

    JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...)

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1  
    Old 11-05-2003, 01:24 PM
    Waterloo1 Waterloo1 is offline
    Registered User
     
    Join Date: Nov 2003
    Posts: 4
    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>
    Reply With Quote
      #2  
    Old 11-05-2003, 02:43 PM
    gil davis's Avatar
    gil davis gil davis is offline
    Nobody important
     
    Join Date: Nov 2002
    Posts: 4,434
    You need more than a javascript to remember a state if the page is replaced by clicking a link. You need a cookie.
    Reply With Quote
      #3  
    Old 11-05-2003, 02:50 PM
    Waterloo1 Waterloo1 is offline
    Registered User
     
    Join Date: Nov 2003
    Posts: 4
    Sorry for the confusion, the page it loads is on the same page but inside a different frame.
    Reply With Quote
      #4  
    Old 11-05-2003, 03:12 PM
    gil davis's Avatar
    gil davis gil davis is offline
    Nobody important
     
    Join Date: Nov 2002
    Posts: 4,434
    Code:
    <script>
    var click1 = false;
    </script>
    ...
    <a ... onmouseout="if(!click1)document.images['nav1'].src='med/main_off.gif'" onclick="click1=true">
    ...
    This takes advantage of the fact that the onmouseover has set the image to the "on" state and the onmouseout is disabled by the onclick.
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 12:11 AM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.