Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Onmouseover Qustion

    Dear friends,

    Is it possible to have something like this:

    onmousover(do1, do2, do3) so that onmousover actions are separated by commas, or semicolons so do1, do2, do3 do different things? It'd be mouseover text.

    Or:

    Is it possible to have text-1 to be moused-over and have somehting like:

    onmouseover text-1 (do1); {show photo2 at place 1}
    onmouseover text-1 (do2); {show photo2 at place2)
    onmouseover text-1 (do3); {write some text at textplace}
    ?

    Thanks, if a simple example possible in case, would be appreciated.

    -mbl-

  • #2
    teh Moderatorinator
    Join Date
    Sep 2004
    Location
    USA
    Posts
    2,472
    Thanks
    4
    Thanked 40 Times in 40 Posts
    If you mean can you do more than one thing with an onmouseover, yes you can...something like this would do two things on mouseover. Very general example but it just shows 2things onmouseover.
    Code:
    <head>
    <script language="javascript">
    function blah()
    {
    	alert("mouseover 1");
    }
    
    function foo()
    {
    	alert("mouseover 2");
    }
    </script>
    </head>
    <body>
    <a href="#" onmouseover="blah(); foo();">Mouseover</a>
    </body>
    </html>
    With images:
    Code:
    <html>
    <head>
    </head>
    <body>
    <img src="img1.gif" name="img1" alt="" border="0" onmouseover="document.img1.src='img2.gif'; document.img2.src='img4.gif';" onmouseout="document.img1.src='img1.gif'; document.img2.src='img3.gif'">
    <img src="img3.gif" name="img2" alt="" border="0">
    </body>
    </html>
    When you mouseover the first image, the first image will change and the second one will change also, then when you mouseout they will change back.
    Last edited by Brandoe85; 10-23-2004 at 07:15 AM.

  • #3
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Dear Brando,

    Your help has been very good.

    In particular, can use the second code given (for images). However, is there a way I could have instead of four images 1 and 2, do-away with images 3 and 4 have Text-1 and Tex-2 appear close to images 1 and 2?

    So that imag-1 appears with Text-1 close to it.
    Then, onmouseover image-1 is replaced by image-2, and
    Text-1 is replaced by Text-2?

    (If possible just modify the text you gave slightly? It was very clear, and use absolute text location, (could fix the location depending on image size) )

    I have understood the original example well, but can't seem to put text as described. Have been trying for a few days.

    Thanks a lot.

    -mbl-


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •