开发者

jquery, how to add 2 different variables for the same call?

i have 2 different tabs setup on the page: tabs1 and开发者_JAVA百科 tabs2 i have this set up:

$( '#tabs1' ).tabs({
 select: function(event, ui) { 
var theSelectedTab = ui.index;

if (theSelectedTab  == 0) {
..do something
}
});

what i want to do is to add another var for the same ui.index"

$( '#tabs2' ).tabs({
 select: function(event, ui) { 
var theSelectedTab1 = ui.index;

if (theSelectedTab1  == 0) {
..do something
}
});

but it looks like var theSelectedTab = ui.index; is conflicting with var theSelectedTab1 = ui.index;

how can i separate them?

thanks


I corrected your code and you can find the complete solution here : http://jsfiddle.net/Ngetw/

I think that the error comes from a missing bracket (}) that should close the select: function(event, ui) { line.

Regards.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜