Web Analytics Made Easy -
StatCounter event bubbling with DOM element - CodingForum

Announcement

Collapse
No announcement yet.

event bubbling with DOM element

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

  • event bubbling with DOM element

    Code:
      // this works fine. Inside someFunc I can event.toElement etc
      <DIV  onMouseOut='someFunc(this,event) ....
    Code:
       myDIVnode = document.createElement("DIV");
       //......
       myDIVnode.onmouseout = function() {someFunc(myDIVnode,?????);};
    hope this make sence. Thanks for replays.
    Found a flower or bug and don't know what it is ?
    agrozoo.net galery
    if you don't spot search button at once, there is search form:
    agrozoo.net galery search

  • #2
    Code:
       myDIVnode = document.createElement("DIV");
       //......
       myDIVnode.onmouseout = function(evt) {someFunc(myDIVnode,evt || window.event);};
    jasonkarldavis.com

    Comment


    • #3
      thanks, exactly what I needed.
      Found a flower or bug and don't know what it is ?
      agrozoo.net galery
      if you don't spot search button at once, there is search form:
      agrozoo.net galery search

      Comment


      • #4
        hello, there seems to be a problem with this call, with mouseOut event using it on IE. This works fine on FF.

        Hmm, forinstance if I write same pattern for mouseOver, then it works ok on both browsers.


        Example:


        Code:
        myDIVnode.onmouseout = function(evt) {dropDownItemOnMouseOut(myDIVnode,evt || window.event);};
        
        
        function dropDownItemOnMouseOut(evt)
          {
             
            // if FF
            if (evt.target)
            {
              sourceControl = evt.target;
            }
            // if IE 
            if (evt.srcElement)
            {
              sourceControl = evt.toElement;
            }
            
        
            // this reports wrong id-s on IE !!??
            alert(sourceControl .id);
          }

        you can test the damn thing here:
        http://86.61.66.17:8084/AgroZoo


        click T button at the bottom, play with lower combo box.
        on mouse over items should turn blue, on mouse out items should turn red.

        Note: in IE ,when u click T button wait for couple of sec, don't play with combo box
        at once, otherwise IE crushes somehow, coudn't find the reason for that yet, must be something with AJAX or somethink.

        Thanks for tips.
        Last edited by BubikolRamios; Oct 7, 2006, 01:35 AM.
        Found a flower or bug and don't know what it is ?
        agrozoo.net galery
        if you don't spot search button at once, there is search form:
        agrozoo.net galery search

        Comment

        Working...
        X