onmouseout not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matt L.

    onmouseout not working

    Does anyone know why the onmouseout isn't working in the following?
    I've just started the script (tho I'm sure I've spent over 40hrs on
    this problem alone) and am trying to get just 2 buttons working before
    I add the other 4. I'm absolutely mystified by the sticky onmouseout.

    I've combined a couple of scripts that I've found in the newsgroup to
    accomodate the mouseovers and "active" button action. Only 1 button
    can be active at a time.

    If you need further info, let me know I'd be happy to furnish. Thanks
    in advance for any advice/comments.
    Matt


    <html>
    <head>
    <script language="JavaS cript">
    <!--
    var btnstate="down" ;
    image01= new Image(42,42)
    image01.src="ne w2_03.gif"
    image02= new Image(42,42)
    image02.src="ne w2_03-over.gif"
    image03= new Image(42,42)
    image03.src="ne w2_07.gif"
    image04= new Image(42,42)
    image04.src="ne w2_07-over.gif"

    function rollover(imagen ame, newsrc){
    document.images[imagename].src=newsrc.src
    }

    function setAllButtonsUp (btnstate){
    //alert(btnstate) ;
    document.exampl e.src='new2_03-over.gif';
    document.exampl e2.src='new2_07 .gif';
    // document.upbutt on3.src=new2_11 .gif
    // document.upbutt on4.src=new2_13 .gif
    // document.upbutt on5.src=new2_16 .gif
    // document.upbutt on6.src=new2_19 .gif
    // document.upbutt on7.src=new2_21 .gif
    }

    function setAllButtonsUp 2(btnstate){
    //alert(btnstate) ;
    document.exampl e.src='new2_03. gif';
    document.exampl e2.src='new2_07-over.gif';
    // document.upbutt on3.src=new2_11 .gif
    // document.upbutt on4.src=new2_13 .gif
    // document.upbutt on5.src=new2_16 .gif
    // document.upbutt on6.src=new2_19 .gif
    // document.upbutt on7.src=new2_21 .gif
    }

    //-->
    </script>
    </head>

    <body>
    <a href="#" onmouseover="ro llover('example ', image02)"
    onmouseout="if( btnstate != down')rollover( 'example', image03)"

    onclick="setAll ButtonsUp('down ');document.exa mple.src='new2_ 03-over.gif';"><im g
    src="new2_03.gi f" name="example">
    </a>
    <a href="#" onmouseover="ro llover('example 2', image04)"
    onmouseout="if( btnstate != 'down')rollover ('example2', image04)"

    onclick="setAll ButtonsUp2('up' );document.exam ple2.src='new2_ 07-over.gif';"><im g
    src="new2_07.gi f" name="example2" >
    </a>
    </body>

    </html>
  • mscir

    #2
    Re: onmouseout not working

    Matt L. wrote:
    [color=blue]
    > Does anyone know why the onmouseout isn't working in the following?[/color]
    <snip>
    [color=blue]
    > var btnstate="down" ;
    > <snip>
    > onmouseout="if( btnstate != down')rollover( 'example', image03)"[/color]


    I didn't see where btnstate was ever set to anything other than 'down'
    so the mouseout event never called the rollover function. You'll
    probably want to set it to something other than 'down' where
    appropriate. If I initialize btnstate to 'up' at the beginning of the
    javascript the following work on my ie6:

    <a href="#" onMouseOut="if( btnstate!='down '){rollover('ex ample1',
    image03)}"><img src="new2_03.gi f" name="example"> </a>
    <a href="#" onMouseOut="if( btnstate!='down '){rollover('ex ample2',
    image04)}"><img src="new2_03.gi f" name="example"> </a>

    Mike

    Comment

    • Lee

      #3
      Re: onmouseout not working

      Matt L. said:[color=blue]
      >
      >Does anyone know why the onmouseout isn't working in the following?
      >I've just started the script (tho I'm sure I've spent over 40hrs on
      >this problem alone) and am trying to get just 2 buttons working before
      >I add the other 4. I'm absolutely mystified by the sticky onmouseout.[/color]
      [color=blue]
      ><a href="#" onmouseover="ro llover('example ', image02)"
      >onmouseout="if (btnstate != down')rollover( 'example', image03)"[/color]

      That missing quote doesn't jump out at you?

      Comment

      • Matt L.

        #4
        Re: onmouseout not working

        Thanks for the tip. I apologize for the sloppy code.

        (I've been staring at these lines for several days now trying figure this
        out)

        In exasperation I must have left it out in my post. Unfortunately, putting
        it where it belongs doesn't fix the problem for me.

        Do you see anything else that is wrong or out of place?

        Appreciate the feedback,
        Matt


        "Lee" <REM0VElbspamtr ap@cox.net> wrote in message
        news:civv4j01ij o@drn.newsguy.c om...[color=blue]
        > Matt L. said:[color=green]
        > >
        > >Does anyone know why the onmouseout isn't working in the following?
        > >I've just started the script (tho I'm sure I've spent over 40hrs on
        > >this problem alone) and am trying to get just 2 buttons working before
        > >I add the other 4. I'm absolutely mystified by the sticky onmouseout.[/color]
        >[color=green]
        > ><a href="#" onmouseover="ro llover('example ', image02)"
        > >onmouseout="if (btnstate != down')rollover( 'example', image03)"[/color]
        >
        > That missing quote doesn't jump out at you?
        >[/color]


        Comment

        • mscir

          #5
          Re: onmouseout not working

          Matt L. wrote:
          <snip>[color=blue]
          > In exasperation I must have left it out in my post. Unfortunately, putting
          > it where it belongs doesn't fix the problem for me.
          > Do you see anything else that is wrong or out of place?[/color]

          Please post all of your code.
          Mike

          Comment

          • Matt L.

            #6
            Re: onmouseout not working

            Mike-
            See your email....

            Matt


            "mscir" <mscir@access4l ess.net> wrote in message
            news:10l7a98e7f 9829@corp.super news.com...[color=blue]
            > Matt L. wrote:
            > <snip>[color=green]
            > > In exasperation I must have left it out in my post. Unfortunately,[/color][/color]
            putting[color=blue][color=green]
            > > it where it belongs doesn't fix the problem for me.
            > > Do you see anything else that is wrong or out of place?[/color]
            >
            > Please post all of your code.
            > Mike[/color]


            Comment

            Working...