You know how to use AJAX to pull rows from a database, but do you know how to create an AJAX-based system to organize the records neatly into pages? You'll know how to do that by the end of this series! This first article shows you how to build the user interface.
Building a Pagination System with AJAX - Defining the scrolling system’s CSS declarations (Page 3 of 4 )
A logical place to start building the presentational layer of this AJAX-driven scrolling system is with precisely defining the CSS rules that will provide the look and feel of each (X)HTML element. That said, here is the set of styling rules that I plan to integrate with the program. Please have a look:
As you can see, the above CSS rules clearly show how the dynamic scrollbar will be created, as well as how the containing DIV, responsible for displaying the chunks of database records, will be included in the respective web document.
I think that the most important things to note here are the “handle” class and the “scrollbar” selector. In each case, I defined the corresponding background image for the elements. When displayed together, these images will simulate the appearance of a real scrollbar.
The rest of the CSS rules are used for styling the containing DIV that I mentioned before, which during a highly inspirational moment I called “datacontainer,” as well as for spicing up all the paragraphs inside the web page.
Obviously, as you’ll know, all this isn’t rocket science at all, therefore let’s jump straight into the next section of this tutorial, so you can see how the (X)HTML markup and the skeleton of the JavaScript functions that I plan to use are properly defined.