I know there is probably a plugin in that does this but this is a learning experience for me so I want to do it on my own.
The page numbers work on a fresh view of the page. http://www.shady-lane.com/roster/
But when I click one of the alphabet links (only ones working at this time) the paging doesn't work. When you click page 2 it resets the roster to the orginal view of the fresh page, even though that data isn't there.
Am I missing something?
Here is my jQuery for this:
Code:
// JavaScript Document
var $j = jQuery.noConflict();
$j(document).ready(function(){
// On Start
$j(".page").addClass("hidden");
$j("#pages").removeClass("hidden").addClass("visible");
$j("#page1").removeClass("hidden").addClass("visible");
// View Pages
$j(".pageNum").click(function(e)
{
e.preventDefault();
$j(".page").removeClass("visible").addClass("hidden");
var temp = $j(this).text();
$j("#page" + temp).addClass("visible");
});
// Main Tabs
$j(".tab").click(function(e){
e.preventDefault();
$j("#roster").empty();
var temp = $j(this).text();
$j("#roster").load("roster.php", {a:1,i:temp},function()
{
$j(".page").addClass("hidden");
$j("#pages").removeClass("hidden").addClass("visible");
$j("#page1").removeClass("hidden").addClass("visible");
});
});
});
The code in question is in red.
|