Newbie Help
Newbie Help
Hi,
How can I shorten this structure? The things I am passing into it are the numerics 1,2,3,4 etc which get passed on to #p and page=
basically I would want to replace it as
#p + $variable
page= +$variable
Wanted to learn how to shorten this code out
-
$("#p1").click(function(){
$('#b').fadeOut(5000);
$("#b").load("/page.php");
$('#b').fadeIn('slow');
});
$("#p2").click(function(){
$('#b').fadeOut(5000);
$("#b").load("/page.php?page=2");
$('#b').fadeIn('slow');
});
$("#p3").click(function(){
$('#b').fadeOut(5000);
$("#b").load("/page.php?page=3");
$('#b').fadeIn('slow');
});
... etc ... to Nth number of pages...
Any help would be greatly greatly appreciated.