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
    New Coder
    Join Date
    Sep 2004
    Location
    Arlington, TX
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation window.event workaround in Firefox?

    Okay Everyone,
    I need to know soon: Is there a workaround for window.event.toElement in Firefox?
    I need to check if on MouseOut the mouse goes to the <body> or another <img> tag.
    If anyone can help I would be most grateful. If I need to clarify just ask.

    Thanks,
    Josh

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,968
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Code:
    function getSourceTag(evt){
      if (!evt) evt = window.event;
      var el = (evt.srcElement) ? evt.srcElement : (evt.target) ? evt.target : null;
      if (el){ 
        window.status = el.tagName; //debug
        switch(el.tagName){
           case "BODY":
              alert("body");
              break;
           case "IMG":
              alert("image");
              break;
           //...
        }
      }
    }
    ...
    <body onmouseover="getSourceTag(event)">

  • #3
    New Coder
    Join Date
    Sep 2004
    Location
    Arlington, TX
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thank you very much!


  •  

    Posting Permissions

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