Web Analytics Made Easy -
StatCounter Onmouseover / Onmouseout from javascript - CodingForum

Announcement

Collapse
No announcement yet.

Onmouseover / Onmouseout from javascript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Onmouseover / Onmouseout from javascript

    Hi

    Is it possible call a javascript function from href=........to do the same thing as an onmouseover command.

    bye
    Allyson

  • #2
    Re: Onmouseover / Onmouseout from javascript

    <a href="javascript:function1()" onmouseover="function2()" onmouseout="function3()">Link</a>

    Originally posted by allyson
    Hi

    Is it possible call a javascript function from href=........to do the same thing as an onmouseover command.

    bye
    Allyson
    Glenn
    vBulletin Mods That Rock!

    Comment


    • #3
      Hi

      Thanks for the response, but it's not quite want I was after. I'm know that onmouseover/out commands usually go after href=....... but they do not seem to work with an image map. I'm using Frontpage 98 and won't allow me to use onmouseover commands with the imagemapping format. What I wanted to do was to call onmouseover from a script, something like:

      function1 {

      onmouseover="function2"
      openurl('http://....."
      }

      href="javascript:function1"


      bye
      Allyson

      Comment


      • #4
        Re: Re: Onmouseover / Onmouseout from javascript

        you can do this but the mouseover/mouseout will only function once the the link is clicked.

        function openLink(objLink){
        objLink.onmouseover=mOver;
        objLink.onmouseout=mOut;
        window.open('page.htm');
        }

        function mOver(){
        //code here
        }

        function mOut(){
        //code here
        }

        <a href="javascriptpenLink(this)">Link</a>
        Glenn
        vBulletin Mods That Rock!

        Comment


        • #5
          I've done some research, but the AREA object should fire Mouseover and Mouseout events just as an A object would, unless this is not part of the DOM yet.
          What do you want to use the onMouseOver and onMouseOut event handlers for, aka what kind of funtion do you want to call? Maybe there's a workaround or such...
          Regards,
          Ronald.
          ronaldvanderwijden.com

          Comment


          • #6
            I tried something like:

            <map ...>
            <area href="..." onMouseOver="alert('this is a circle!')" ...>
            ...
            </map>

            (dots: ... represent uninteresting bits left out here)
            and that works just fine in IE 5.0! Simply add a mouseover event handler somewhere within the area tag and you can call whatever function you please.
            Regards,
            Ronald.
            ronaldvanderwijden.com

            Comment

            Working...
            X