Results 1 to 5 of 5

Thread: multiple onmouseover events

  1. #1
    Join Date
    May 2006
    Posts
    98
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default multiple onmouseover events

    Hi,
    I would like to have a mouseover event change on each mouseover. For example, each time someone mouseovered a link a different image would appear.
    Does anyone know if this is possible?

    Any pointers would be a great help.
    Thanks
    Richard

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Hi:
    Well in general, you can define multiple onmouseover events (or any event for that matter) by separating each one with a semi colon, something like:

    Code:
    <a href="#" onMouseover="dothis(); dothat()">Test</a>

  3. #3
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    If your talking about more of a "random function" on mouseover, you might want to use something like:
    Code:
    <script>
    function a_test(){
        var number = Math.floor(Math.random()*5);
        if(number == 1){
            function1();
        }else if(number == 2){
            function2();
        }else if( number ==3){
            function3();
        }else{
            function4();
        }
    }
    </script>
    
    <a href="#" onmouseover="a_test()">click me</a>
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  4. #4
    Join Date
    Oct 2008
    Location
    Livermore, CA
    Posts
    7
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default more information please

    I would like to see that script for onmouseover that continues from
    <a href="#" onMouseover="dothis(); dothat()">Test</a>

    I would like to change a button, which I can do and change a .jpg elsewhere in the same page as the mouse travels over each menu button. I understand the basics, but this is confusing me.

  5. #5
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,627
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    You can check a demo page I've posted in the following location - the 2nd reply from the top.

    http://www.dynamicdrive.com/forums/s...ad.php?t=37323

    Hope this helps.

Bookmarks

Posting Permissions

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