Home
Dynamic Content
Iframe and Ajax
Ajax Pagination Script
Supplementary Page
|
Categories
Other Sections
Sweet Ads
Compatibility
|
|
Valid syntax for the external pages' file pathsWhen setting the external pages' paths inside the var mysettingsvar={ The first few file paths assume the file is in the same directory as the current page while the last one is a absolute URL to the desired file. When specifying an absolute URL to be fetched, that URL must be on the same domain as the page making the request due to Ajax security limitations. Customizing the style/ look of the pagination interfaceThe style of the pagination interface is controlled by the CSS file
ajaxpagination.css. In here you can customize
the general color, how large the text appears, and basically anything
accessible by CSS. Do NOT modify the names of any of the CSS classes,
however, as these names are assumed to be fixed by the script, dynamically
assigned to the pagination DIV. Structurally, the pagination interface consists of
sequential links inside a HTML list ( One of the interesting things you can customize via the .css file is how the "previous" and "next" links appear when they are disabled (ie: user has reached the end of all available pages). By default, they appear greyed out: .pagination a.disabled, .pagination a.disabled:hover{
/*Style for "disabled" previous or next link*/ You can, for example, hide the link altogether instead, by using: .pagination a.disabled, .pagination a.disabled:hover{
/*Style for "disabled" previous or next link*/ Defining "settingsvar" dynamically when the page first loadsThe "settings" variable that you define and pass into <script type="text/javascript"> Now, this variable can obviously be defined manually. However, if you're using the script to display pages dynamically retrieved from the server, you'll want to dynamically write out this variable to contain the proper settings as well. Here's a PHP/ MyQL code example that gets the last 5 IDs of the pages to show from the database before dynamically writing out the "settings" variable to contain the 5 pages to paginate based on that info: <script type="text/javascript"> We dynamically write out the JavaScript variable " Selecting a page dynamicallyYou can explicitly select a page within the paginated content to jump to anywhere on your page or inside your scripts by calling the method: bookvarinstance. Where "page_number" is an integer designating the desired page
number to load (0=1st page, 1=2nd page etc). The following link selects the 3rd
page of the paginated content instance with variable reference "
Refreshing Ajax Pagination instance with new dataYou can refresh the paginated content even after it initially
loads with new content, by calling its bookvarinstance.refresh(newsettingsvar) For example: <div id="paginate-top"> </div> Demo:
Multiple Ajax Pagination instances on the same pageFinally, you can certainly have more than one instance of Ajax Pagination script running on the same page. Just go through the instructions for each instance, making sure the variables and element IDs at every turn is unique. Table Of ContentsThis script consists of an index page plus a supplementary page:
|