views:

15

answers:

1

Hi, I'm working on a site which uses the EZPZ tooltip jquery plugin, and I have the style of the page changing dramatically when a button is clicked, making the tooltip pointless.
But, I can't for the life of me figure out how to unbind the event from the <li>. Here's the code that is used to actually set up the tooltip on the li's:

var ttObj = $('.listView span');
var ttArr = jQuery.makeArray(ttObj);
$.each(ttArr, function (key, value) {
    var positionTip = "rightStatic";
    if (IS_IE7) {
        positionTip = "rightStaticIE";
    }
    $(value).ezpz_tooltip({
        contentPosition: positionTip,
        stayOnContent: true,
        offset: -495
    });
});

Any help would be greatly appreciated. Thanks.

+1  A: 

Hm, your code suggests the events aren't bound to li-element but to span-elements.

Assuming that's correct, you should do this in your button click handler:

$('.listView span')
  .unbind('mouseover')
  .unbind('mouseout')
  .unbind('mousemove');

Note, though, that this unbinds all handlers for those events, not just the ones bound by ezpz. It might be possible to unbind them all in one call in jQuery 1.4.2, like so:

$('.listView span').unbind('mouseover mouseout mousemove');
Thomas
Ah thanks a lot, that did the trick. I was actually unbinding the li instead of the span so it was more of a stupid mistake, but I wasn't aware of that syntax for 1.4.2, so I also learned something, so that's a win for me. Thanks!
Munzilla
Always just a tiny oversight, isn't it? :D
Thomas