English 中文(简体)
职能分工
原标题:Disable a function
最佳回答

EDIT: Heres a thought... try taking your override out of the ready statement. That way it should override the function definition before onReady is ever fired.

this.tooltip = function(){return false;};

这一工作之所以成功,是因为文字在外部档案中自称,因此,如果你试图在交出之前使它成为一个空白功能的话,那么它就会凌驾于它之上,如果你在接下去之后这样做的话,那么,你就已经把自己的活动推向了脚步。 您不能把文件放在你想要工具的网页上。

处理这项工作的一个容易的方法是使指定职能而不是匿名的事件处理者能够轻易地从带有<代码>(a.tooltip ).unbind(点击,工具tipClick);的活动顶点中排除这些职能。 更彻底的方法是,用取消选择或取消这种性质的东西,把这种选择归根于你们自己的 p。 此外,还有几处用于 j脏的ip子,即使并非全部都允许拆解。

问题回答

你不需要把工具的功能(因为其目的只是一劳永逸地运作),而是增加了一些内容的匿名功能。

这样做是有办法的,只有你能够改变原来的工具代码,在约束匿名职能时列入一个名称空间。

一些例子。

在工具来源代码中

$("a.tooltip").hover(function(e){...})

这应当

$("a.tooltip").bind( hover.tooltip ,(function(e){...});

紧靠背边的通道意味着,我们已经为这一职能确定了一个名称空间,我们现在可以把它同起来。

$("a.tooltip").unbind( hover.tooltip );

奥基,我得以履行这一职能。 但这似乎是一种黑客式的解决办法,可能不是最棘手的解决办法。

$(document).ready(function() {
 $(".tooltip").mouseover(function(){ $( #tooltip ).remove() });
});

如果出现任何更好的想法,我就不谈这个问题。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签