I know this specific question has been asked before , but I am not getting any results using the bind()
event on the jQuery UI Tabs
plugin.
(我知道之前已经问过这个具体问题,但是我没有在jQuery UI Tabs
插件上使用bind()
事件获得任何结果。)
I just need the index
of the newly selected tab to perform an action when the tab is clicked.
(我只需要新选择的选项卡的index
,以便在单击选项卡时执行操作。)
bind()
allows me to hook into the select event, but my usual method of getting the currently selected tab does not work.(bind()
允许我挂钩到select事件,但是我通常的获取当前选中选项卡的方法不起作用。)
It returns the previously selected tab index, not the new one:(它返回先前选择的选项卡索引,而不是新选项卡索引:)
var selectedTab = $("#TabList").tabs().data("selected.tabs");
Here is the code I am attempting to use to get the currently selected tab:
(以下是我尝试用于获取当前所选标签的代码:)
$("#TabList").bind("tabsselect", function(event, ui) {
});
When I use this code, the ui object comes back undefined
.
(当我使用这段代码时,ui对象返回undefined
。)
From the documentation, this should be the object I'm using to hook into the newly selected index using ui.tab.(从文档中,这应该是我用来使用ui.tab挂??钩到新选择的索引的对象。)
I have tried this on the initial tabs()
call and also on its own.(我已经在初始的tabs()
调用上尝试了这个,也是自己的。)
Am I doing something wrong here?(我在这里做错了吗?)
ask by Mark Struzinski translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…