简体   繁体   English

如何在jQuery中禁用EZPZ工具提示鼠标悬停事件?

[英]How do I disable an EZPZ tooltip mouseover event in jquery?

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. 我正在使用EZPZ工具提示jquery插件的网站上工作,单击按钮时页面的样式发生了巨大变化,从而使工具提示毫无意义。
But, I can't for the life of me figure out how to unbind the event from the <li> . 但是,我无法终生解决如何从<li>取消绑定事件。 Here's the code that is used to actually set up the tooltip on the li's: 这是用于在li上实际设置工具提示的代码:

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. 谢谢。

Hm, your code suggests the events aren't bound to li-element but to span-elements. 嗯,您的代码表明事件不限于li-元素,而与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. 但是请注意,这将取消绑定那些事件的所有处理程序,而不仅仅是ezpz绑定的那些处理程序。 It might be possible to unbind them all in one call in jQuery 1.4.2, like so: 可以在jQuery 1.4.2中的一次调用中将它们全部解除绑定,如下所示:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM