在http://docs.jquery.com/UI/Tabs#demo我发现下面关于在选项卡向导上创建事件的描述。在我看来,两种方式都将回调函数与 create 事件联系起来。但我相信它们的用法一定有一些不同。是否应该在创建选项卡时使用第一种方法,而在构建选项卡后使用第二种方法?
//方法1
Supply a callback function to handle the create event as an init option.
$( ".selector" ).tabs({
create: function(event, ui) { ... }
});
//方法2
Bind to the create event by type: tabscreate.
$( ".selector" ).bind( "tabscreate", function(event, ui) {
...
});