onmouseover question

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

    onmouseover question

    I know I can have like <a href="#" onclick="dothis " onmouseover="do that">
    But how do you properly code two mouseover's in one statement?
    <a href="#" onmousever="dot his" onmouseover="do that">

    As an example of use:
    Column A holds menu items.
    When a mouse over is performed, two actions take place instead of one.
    Action one sends an image to a division in column B, action two sends text
    to another division in column B.

    What's the trick?

    I am searching google for the answer as well.


  • Randy Webb

    #2
    Re: onmouseover question

    Richard wrote:[color=blue]
    > I know I can have like <a href="#" onclick="dothis " onmouseover="do that">
    > But how do you properly code two mouseover's in one statement?
    > <a href="#" onmousever="dot his" onmouseover="do that">[/color]

    <a href="#" onmouseover="do This();doThat() ">
    OR:
    <a href="#" onmouseover="do Both()">

    function doBoth(){
    doThis();
    doThat();
    }

    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq

    Comment

    • Richard

      #3
      Re: onmouseover question

      On Fri, 7 Jan 2005 20:57:11 -0600 Richard wrote:
      [color=blue]
      > I know I can have like <a href="#" onclick="dothis "
      > onmouseover="do that">
      > But how do you properly code two mouseover's in one statement?
      > <a href="#" onmousever="dot his" onmouseover="do that">[/color]
      [color=blue]
      > As an example of use:
      > Column A holds menu items.
      > When a mouse over is performed, two actions take place instead of one.
      > Action one sends an image to a division in column B, action two sends
      > text
      > to another division in column B.[/color]
      [color=blue]
      > What's the trick?[/color]
      [color=blue]
      > I am searching google for the answer as well.[/color]

      Ok. Sort of found the solution I guess. Simple enough.

      onmouseover="do this" ; "do that"


      Now all I need to do is to figure out how to place the two actions in the
      proper divisions.


      Comment

      • RobG

        #4
        Re: onmouseover question

        Richard wrote:
        [...][color=blue]
        > onmouseover="do this" ; "do that"[/color]

        Bzzzzt. "do that" will not be called.

        As Randy posted:

        onmouseover="do this(); dothat()"

        --
        Rob

        Comment

        • Richard

          #5
          Re: onmouseover question

          On Fri, 07 Jan 2005 22:31:17 -0500 Randy Webb wrote:
          [color=blue]
          > Richard wrote:[color=green]
          >> I know I can have like <a href="#" onclick="dothis "
          >> onmouseover="do that">
          >> But how do you properly code two mouseover's in one statement?
          >> <a href="#" onmousever="dot his" onmouseover="do that">[/color][/color]
          [color=blue]
          > <a href="#" onmouseover="do This();doThat() ">[/color]
          [color=blue]
          > <a href="#" onmouseover="do Both()">[/color]
          [color=blue]
          > function doBoth(){
          > doThis();
          > doThat();
          > }[/color]

          Thanks Randy.
          I figured it was purely in the syntax thing.



          Comment

          • Richard

            #6
            Re: onmouseover question

            On Fri, 07 Jan 2005 22:31:17 -0500 Randy Webb wrote:
            [color=blue]
            > Richard wrote:[color=green]
            >> I know I can have like <a href="#" onclick="dothis "
            >> onmouseover="do that">
            >> But how do you properly code two mouseover's in one statement?
            >> <a href="#" onmousever="dot his" onmouseover="do that">[/color][/color]
            [color=blue]
            > <a href="#" onmouseover="do This();doThat() ">[/color]
            [color=blue]
            > <a href="#" onmouseover="do Both()">[/color]
            [color=blue]
            > function doBoth(){
            > doThis();
            > doThat();
            > }[/color]
            [color=blue]
            > --
            > Randy
            > comp.lang.javas cript FAQ - http://jibbering.com/faq[/color]


            Would this work then?

            onmouseover="ch angetext(conten t[1]);changetext(co ntent[2])"

            But what I aiming at doing is, having the content in two seperate divisions
            change at the same time.
            So perhaps I could have:
            onmouseover="ch angetext(conten t[1]);changeimage(c ontent[2])"



            Comment

            • Randy Webb

              #7
              Re: onmouseover question

              Richard wrote:[color=blue]
              > On Fri, 07 Jan 2005 22:31:17 -0500 Randy Webb wrote:
              >
              >[color=green]
              >>Richard wrote:
              >>[color=darkred]
              >>>I know I can have like <a href="#" onclick="dothis "
              >>>onmouseover= "dothat">
              >>>But how do you properly code two mouseover's in one statement?
              >>><a href="#" onmousever="dot his" onmouseover="do that">[/color][/color]
              >
              >[color=green]
              >><a href="#" onmouseover="do This();doThat() ">[/color]
              >
              >[color=green]
              >><a href="#" onmouseover="do Both()">[/color]
              >
              >[color=green]
              >>function doBoth(){
              >>doThis();
              >>doThat();
              >>}[/color]
              >
              >
              >
              >
              > Would this work then?
              >
              > onmouseover="ch angetext(conten t[1]);changetext(co ntent[2])"[/color]

              Test it and see :-)

              [color=blue]
              > But what I aiming at doing is, having the content in two seperate divisions
              > change at the same time.
              > So perhaps I could have:
              > onmouseover="ch angetext(conten t[1]);changeimage(c ontent[2])"[/color]

              Lets say you have a div tag with id="myDiv" and an image with
              name="myImage". If you want to change it, then you pass a single
              parameter to a single function that then changes it all.

              var content = new Array()
              content[0] = ['...','...'];
              content[1] = ['...','...'];
              content[2] = ['...','...'];
              content[3] = ['...','...'];

              function changeIt(param( {
              document.getEle mentById('myDiv ').innerHTML = content[param][0];
              document.images['myImage'].src = content[param][1];
              }

              <a href="#" onmouseover="ch angeIt(1)" onmouseout="cha ngeIt(0)
              onclick="return false">Change it to 1</a>
              <a href="#" onmouseover="ch angeIt(2)" onmouseout="cha ngeIt(0)
              onclick="return false">Change it to 2</a>
              <a href="#" onmouseover="ch angeIt(3)" onmouseout="cha ngeIt(0)
              onclick="return false">Change it to 3</a>

              And so on.



              --
              Randy
              comp.lang.javas cript FAQ - http://jibbering.com/faq

              Comment

              • Richard

                #8
                Re: onmouseover question

                On Sat, 08 Jan 2005 02:27:15 -0500 Randy Webb wrote:
                [color=blue]
                > Richard wrote:[color=green]
                >> On Fri, 07 Jan 2005 22:31:17 -0500 Randy Webb wrote:[/color][/color]

                [color=blue][color=green][color=darkred]
                >>>Richard wrote:[/color][/color][/color]
                [color=blue][color=green][color=darkred]
                >>>>I know I can have like <a href="#" onclick="dothis "
                >>>>onmouseover ="dothat">
                >>>>But how do you properly code two mouseover's in one statement?
                >>>><a href="#" onmousever="dot his" onmouseover="do that">[/color][/color][/color]

                [color=blue][color=green][color=darkred]
                >>><a href="#" onmouseover="do This();doThat() ">[/color][/color][/color]

                [color=blue][color=green][color=darkred]
                >>><a href="#" onmouseover="do Both()">[/color][/color][/color]

                [color=blue][color=green][color=darkred]
                >>>function doBoth(){
                >>>doThis();
                >>>doThat();
                >>>}[/color][/color][/color]



                [color=blue][color=green]
                >> Would this work then?[/color][/color]
                [color=blue][color=green]
                >> onmouseover="ch angetext(conten t[1]);changetext(co ntent[2])"[/color][/color]
                [color=blue]
                > Test it and see :-)[/color]

                [color=blue][color=green]
                >> But what I aiming at doing is, having the content in two seperate
                >> divisions
                >> change at the same time.
                >> So perhaps I could have:
                >> onmouseover="ch angetext(conten t[1]);changeimage(c ontent[2])"[/color][/color]
                [color=blue]
                > Lets say you have a div tag with id="myDiv" and an image with
                > name="myImage". If you want to change it, then you pass a single
                > parameter to a single function that then changes it all.[/color]
                [color=blue]
                > var content = new Array()
                > content[0] = ['...','...'];
                > content[1] = ['...','...'];
                > content[2] = ['...','...'];
                > content[3] = ['...','...'];[/color]
                [color=blue]
                > function changeIt(param( {
                > document.getEle mentById('myDiv ').innerHTML = content[param][0];
                > document.images['myImage'].src = content[param][1];
                > }[/color]
                [color=blue]
                > <a href="#" onmouseover="ch angeIt(1)" onmouseout="cha ngeIt(0)
                > onclick="return false">Change it to 1</a>
                > <a href="#" onmouseover="ch angeIt(2)" onmouseout="cha ngeIt(0)
                > onclick="return false">Change it to 2</a>
                > <a href="#" onmouseover="ch angeIt(3)" onmouseout="cha ngeIt(0)
                > onclick="return false">Change it to 3</a>[/color]
                [color=blue]
                > And so on.[/color]

                Thanks Randy. I'll figure it out eventually.



                Comment

                Working...