Skip to content Skip to sidebar Skip to footer

MouseUp Not Working In IE (sigh!!!!)

function startstretchright(aObj) { watcherObj = aObj.parentNode.parentNode; var dragWorkspaceDiv = document.createElement('div'); var dragWorkspaceObj = document.body.

Solution 1:

When you remove an event, you need to pass the identical function that you used to add it.

When you add an event handler you used: function() { stopstretching(watcherObj); } for mouseup and function() { stopstretching(watcherObj); } for mouseout (these two are different)

So when you remove, you can't just use stopstretching because it's not the one you added. Maybe you can have something like

function stopHandler() {
    stopstretching(watcherObj, stopHandler);
}
addEvent(dragWorkspaceObj, 'mouseup', stopHandler);
addEvent(dragWorkspaceObj, 'mouseout', stopHandler);

And

function stopstretching(watch, handler) {
    watcherObj = null;
    removeEvent(document.getElementById("dragWorkspace"), 'mouseup', handler);
    removeEvent(document.getElementById("dragWorkspace"), 'mouseout', handler);

The code is untested, but I think that it should work.


Post a Comment for "MouseUp Not Working In IE (sigh!!!!)"