0
こんにちは私はいくつかのjqueryプラグインを作成しています。しかし、私はイベントを追加する方法を説明するチュートリアルを見つけることができません(例えば、コール関数の方がいいと思います)。たとえば、myplugin openイベントで関数を呼びたいとします。 openイベントのようなjqueryダイアログイベントに似た何かをしたい:jqueryプラグインを作成する
$('#adialog').dialog({
open:function()
{
//I know this will be called on open of a dialog, how to do in my plugin?
}
});
それでは、私がしたいことはこれです:
$('#somediv').myplugin({
onOpen:function()// this is not clear how to do it in plugin
{
//do stuff here
},
background-color:'red',//this is clear, $.extends defaults options
text:'blablabla',// this is clear $.extends defaults options
.........
});
私は単純に、たとえば、「イベント」は、プラグインのイベント・メソッドのために立って、私のプラグインに「イベント」を追加する方法を知りたいですhttp://jqueryui.com/demos/draggable/#eventsには、イベントタブにはいくつかの機能を持つイベントがあります。
はい良いおかげで – albanx