moabi
moabi

Reputation: 1399

jQuery UI api - Tabs - getting selected

I couldn't find what I'm doing wrong here...
I'm trying to apply some effect on the selected <li> of the navigation, I'm getting the index of it but I can't apply anything on it :

$("#tabs").bind('tabsselect', function(event, ui) {
var choosen = ui.index;
console.log(choosen);
$('#tabs ul').find('li:eq(choosen)').toggleClass('selectedone');
});

Upvotes: 0

Views: 79

Answers (1)

SGB
SGB

Reputation: 636

at a guess it looks like you are sending the string choosen to the find function rather than the value of choosen - so I would say you need to try instead

$('#tabs ul').find('li:eq(' + choosen + ')').toggleClass('selectedone');

Upvotes: 1

Related Questions