I have the following JQuery statement and it is adding the class ‘current’ but it is not removing the class form the siblings.
Any ideas why?
$('.page_link[longdesc=' + page_num + ']')
.addClass('current').siblings('.current').removeClass('current');
Malcolm
Without your HTML markup, I’m guessing your classes aren’t direct siblings but wrapped in something (to give them a border maybe?) In that case,
.siblings()isn’t finding anything.In any case, it might be simpler to just remove
currentfrom allclass="page_link"elements without caring where they are, like this: