I'm looking for some newbie Javascript help.
I've got a series of simple functions which add and remove some slider content using JQuery, following a click from a callout. How can this be rewritten to work with any category ('cat1' etc) content?
$('.cat1_link').click(function(event) {
$('.category_slides li').fadeOut();
$('.cat1').fadeIn();
$('article.listitem').removeClass('current');
$('article.listitem.cat1').addClass('current');
});
$('.cat2_link').click(function(event) {
$('.category_slides li').fadeOut();
$('.cat2').fadeIn();
$('article.listitem').removeClass('current');
$('article.listitem.cat2').addClass('current');
});