jquery - "li.menuItem:first" to "li.menuItem:second"? -


on page load, javascript makes first thumbnail active, change second, third or fourth thumbnail depending on page loading.

the javascript works first thumbnail active:

$('#menu ul li.menuitem:first').addclass('act').siblings().addclass('inact'); /* on page load, mark first thumbnail active */ 

i've tried changing to:

$('#menu ul li.menuitem:second').addclass('act').siblings().addclass('inact'); 

but didnt work..what proper code changing second, third, fourth etc..

use :eq() selector...

$('#menu ul li.menuitem:eq(2)') 

keep in mind :eq() 0 based.


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -