remove IE6 mouse event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nibbus
    New Member
    • Nov 2007
    • 18

    remove IE6 mouse event

    Hi there!


    I had some problems putting mouse events to work on IE6 some days ago. After googling a bit I found this solution:

    Code:
    function addOnMouseOver(obj, id)
    {
            obj.onmouseover = function() {
                changeProcessOpacity(id);
                };
            obj = null;
    }
    This works fine, and solves me the annoying thing of IE assuming the event, but not doing anythingwith it when I pass it like this

    Code:
    obj.setAttribute('onmouseover', "changeProcessOpacity(id);");
    Don´t know if it´s common thing on IE6 or just my "noobity", but it didn´t work...

    My question now is how can I remove the event using my approach. I´m passing an empty function, but IE is not liking it...

    Any suggestions would be greatly appreciated.
    Thanks in advance,

    Nibbus
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    [code=javascript]obj.onmouseover = null;[/code] should remove the event.

    IE can't attach events with setAttribute.

    Comment

    • Nibbus
      New Member
      • Nov 2007
      • 18

      #3
      Originally posted by acoder
      [code=javascript]obj.onmouseover = null;[/code] should remove the event.

      IE can't attach events with setAttribute.

      Thanks, it seems to work ;)
      I kept the obj = null; at the end, I think that it brings no problem.

      Thanks again

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Glad to hear that it worked :)

        Comment

        Working...