Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Senior Member Seldimi's Avatar
    Join Date
    Dec 2002
    Location
    Kozani, Greece
    Posts
    488
    Member #
    409
    Goodmorning and goodafternoon,
    Is there any way to make with javascript or dthml when on mouseover of the button to display a pre-defined text in an area and when going on other to change again??? (When there is not mouseover to display a pre-defined text again).

    Something like on status messages when mouseovering but in the html page.

    Thanks in advance
    - Webmaster's Planet . Greek Vortal For Webmasters ...
    - MyPortFolio - View My Creations

  2.  

  3. #2
    Senior Member skrlin's Avatar
    Join Date
    Apr 2003
    Location
    Illinois
    Posts
    562
    Member #
    1063
    Code:
    <input type="button" value="click here"
       onMouseOver="this.value='Nevermind, don\'t click here!'"
       onMouseOut="this.value='Click here'"
       onClick="alert('You clicked me !!?!?!')">
    - Brian

  4. #3
    JR
    JR is offline
    Senior Member JR's Avatar
    Join Date
    Nov 2002
    Location
    UK
    Posts
    4,354
    Member #
    257
    Liked
    1 times
    or another way (because i am not sure what you want to do)...

    Code:
    
    <head>
    <script type="text/javascript">
    function status(state) {
    if (state == 'on') {
    document.getElementById('txtarea').innerHTML = 'on msg';
    } else {
    document.getElementById('txtarea').innerHTML = 'off msg';
    }
    }
    </script>
    </head>
    <body>
    <input type="button" onMouseOver="status('on') onMouseOut="status('off')"><br><br>
    
    <span id="txtarea"></span>
    </body>
    
    should work
    JR

  5. #4
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Expanding on JR's concept:
    Code:
    <head>
        <script type="text/javascript">
        function displayMessage(message) {
            document.getElementById('txtarea').innerHTML = message;
            window.clearTimeout();
        }
        function clearMessage() {
            window.setTimeout("displayMessage('');", 500);
        }
        </script>
    </head>
    <body>
        <a href="#" onmouseover="displayMessage('message 1');" onmouseout="clearMessage();">Link 1</a><br>
        <a href="#" onmouseover="displayMessage('message 2');" onmouseout="clearMessage();">Link 2</a><br>
        <span id="txtarea"></span>
    </body>

  6. #5
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    And here it is in action (notice the timeouts)

  7. #6
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    Made some mods to the timeout (it was having problems):

  8. #7
    Senior Member Seldimi's Avatar
    Join Date
    Dec 2002
    Location
    Kozani, Greece
    Posts
    488
    Member #
    409
    Nice, thanx guys
    - Webmaster's Planet . Greek Vortal For Webmasters ...
    - MyPortFolio - View My Creations

  9. #8
    WDF Staff smoseley's Avatar
    Join Date
    Mar 2003
    Location
    Boston, MA
    Posts
    9,729
    Member #
    819
    Liked
    205 times
    No "thanx".... Turtle Dollars !!!


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 06:43 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2020 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com