This (of course) does not work. But is there a way to do this?
var someNumber= 1;
$("#navBar div:nth-child(someNumber)").addClass('selected');
I've tried .eq (:eq and .index) and it works fine when using a number BUT NOT when using a variable.
I'm trying to make a slide-show and the navBar shows which slide is active, but that is irrelevant.