I currently have this jquery code to set the current class, I am a bit of a novice with jquery and would like to know how to make this cleaner and more compact. It currently works but I would like to know how to do it better.
// add class current
$('.textResizing ul .normal a').click(function () {
$('.textResizing ul .normal a').addClass('current');
$('.textResizing ul .medium a').removeClass('current');
$('.textResizing ul .large a').removeClass('current');
});
$ ('.textResizing ul .medium a').click(function () {
$('.textResizing ul .medium a').addClass('current');
$('.textResizing ul .normal a').removeClass('current');
$('.textResizing ul .large a').removeClass('current');
});
$ ('.textResizing ul .large a').click(function () {
$('.textResizing ul .large a').addClass('current');
$('.textResizing ul .normal a').removeClass('current');
$('.textResizing ul .medium a').removeClass('current');
});
Not sure what your html looks like but something like this? :