Really quick jQuery question...
I have this function:
$(document).ready(function() {
$('a#show1').click(function() {
$('.item1').toggle(1000);
return false;
});
$('a#show2').click(function() {
$('.item2').toggle(1000);
return false;
});
// And it goes on...
});
The page the script runs on has any number of show
and item
divs, all unique and identified as itemX
How can I rewrite the repeated and identical functions for show1
and show2
so that it ends up essentially like this:
$('a#showX').click(function() {
$('.itemX').toggle(1000);
return false;
});