jQuery工具 - >工具提示破坏方法? [英] jQuery Tools -> Tooltip destroy method?

查看:99
本文介绍了jQuery工具 - >工具提示破坏方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

除了jQuery UI日历之外,我还在表格中使用Flowplayer的jQuery Tools框架(特别是工具提示插件)。

I am using Flowplayer's jQuery Tools framework (specifically the tooltips plugin) in a table, in addition to jQuery UI calendar.

表格的每一行都有能力在它上面和下面插入一行。

Each row of the table has the ability to insert a row above and below it.

执行此操作时,我将克隆点击的对象(事件和对象)并将其直接插入到上方或下方。

When doing this I am cloning the clicked object (events and objects) and inserting it directly above or below.

添加新行后,我刷新表格,为我的元素生成新的id,重新初始化datepicker,并尝试重新初始化工具提示。

After adding a new row, I refresh the table, generating new id's for my elements, reinitializing the datepicker, and attempting to reinitialize the tooltip.

我正在寻找一种方法从实例中完全销毁它并重新应用它。

I am searching for a way to destroy it altogether from the instance and reapply it.

我正在寻找类似 datepicker('destroy')方法。

$ j($ editRow).find('input.date ')。datepicker('destroy')。datepicker({dateFormat:'mm-dd-yy',defaultDate:defaultDateStr});

我已经尝试过:


  1. 取消绑定鼠标悬停和焦点事件:当重新调用工具提示时,它会自动转到它所生成的对象。

  1. to unbind the mouseover and focus events : when reinvoking tooltip, it automatically goes for the object it was made from.

隐藏工具提示DOM元素,从中删除工具提示对象目标,然后重新申请。同样的事情发生在(1)

hide the tooltip DOM element, remove the tooltip object from the target, and reapply it. The same thing happens as (1)

我有没有办法自己创建一个destroy方法?

Is there way I can create a destroy method myself?

推荐答案

我尝试了kwicher的方法,但无法让它工作。虽然我试图改变缩小的代码,但我并不完全确定我找到了合适的地方进行更改。

I tried kwicher's method, and could not get it to work. Although I was trying to alter the minified code, and I'm not entirely sure I found the right place to make the change.

然而,我做到了工作。 ValidationFailed是我应用于所有输入字段的类,它们也有应用工具提示。

I did, however, get this to work. ValidationFailed is a class I am applying to all the input fields that are also having tooltips applied to them.

$('.validationFailed').each(function (index) {
    $(this).removeData('tooltip');
});

$('.tooltip').remove();

我尝试了几种不同的方式,这是唯一允许我添加其他工具提示的组合删除后,不会阻止新的工具提示正常工作。

I tried this several different ways, and this was the only combination that allowed me to add additional tool tips post-removal, without preventing the new tooltips from working properly.

我可以说,工具提示类删除处理摆脱实际的工具提示div,其事件是也直接连线。 .removeData允许将来重新绑定工具提示。

As best I can tell, the tooltip class removal handles getting rid of the actual tooltip divs, whose events are also wired up directly. The .removeData allows the tooltip to be re-bound in the future.

这篇关于jQuery工具 - >工具提示破坏方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆