I’m trying to get at the first not(.hidden) div after the .focus div. In this example the focus is X2, and I should get back X5, skipping X3 and X4 because they are hidden.
<div id='CONTAINER'>
<div id='X1'>eks1</div>
<div id='X2' class='focus'>eks2</div>
<div id='X3' class='hidden'>eks3</div>
<div id='X4' class='hidden'>eks4</div>
<div id='X5'>eks5</div>
<div id='X6'>eks6</div>
</div>
This seems like it should be a pretty simple jquery question, but I’m fairly new to this stuff.
The below statement should solve your problem.
$("#CONTAINER").find("div.focus").nextAll("div").not(".hidden").first();