English 中文(简体)
通过了多条论据到美元。
原标题:Pass multiple arguments to $.delegate

the arguments come from jQuery as $(this) and contain multiple elements :)

审判

  $( #el ).delegate($(this),  click  ...

  $( #el ).delegate($(this).each(),  click  ...

无。


(function($){
  $.fn.myfunction= function(){

    // here i need to somehow find .a, .b., .c etc... 
    $( #el ).delegate($(this),  click , function(event){

    });

  });
});

稍后我呼吁:

  jQuery(document).ready(function($){
      $( .a, .b, .c ).myfunction();
  });

因此,我要谈谈所有新的问题。

最佳回答

根据你的代码,您需要<代码>$(xx)>.bind(点击、功能(e){......};$(xxx”)live(点击、功能(e){......});。

如在jquery v1.7上,是使用的功能,而off()则逆差。

问题回答

您应加上普通手稿:

$(this).bind( click , ...);

您也可写上<条码>美元(原文)。





相关问题
C# delegate with string reference to c++ callback

I wrote a C# application that uses an unmanaged c++ dll via managed c++ dll. In the unmanaged dll, there s a callback that one of its params is std::string&. I can t seem to find the right way to ...

how to call anonymous delegate dynamically

I hava a delegate public delegate void Context(); And i had implemented it by anonymous method, public Context fakeHttpContext = () => { ... create fake ...

self.delegate = self; what s wrong in doing that?

self.delegate = self; what s wrong in doing that? and what is the correct way of doing it? Thanks, Nir. Code: (UITextField*)initWith:(id)sender:(float)X:(float)Y:(float)width:(float)hieght:(int)...

Compiler treatment of a Delegate

If i declare a delegate public delegate void firstDelegate(string str); firstDelegate handler = Strfunc; handler("Hello World"); .. static void Strfunc(string str) { Console....

Practical use of interface events [closed]

What is a good example of the power of interface events (declaring events inside interface)? Most of the times I have seen only public abstract methods inside interface.

Delegates in C#

I`m having some trouble in understanding how delegates in C# work. I have many code examples, but i still could not grasp it properly. Can someone explain it to me in "plain english"? Of course! ...

热门标签