On page load, the javascript makes the first thumbnail active, but i would like to change it to the second, third or even fourth thumbnail depending on the page that it is loading.
The javascript works for first thumbnail as active:
$('#menu ul li.menuItem:first').addClass('act').siblings().addClass('inact');
/* On page load, mark the first thumbnail as active */
i’ve tried changing it to:
$('#menu ul li.menuItem:second').addClass('act').siblings().addClass('inact');
but didnt work..what is the proper code for changing it to second, third, fourth etc..
Use the
:eq()selector…Keep in mind that
:eq()is 0 based.