Home arrow JavaScript arrow Page 2 - Introducing the Quick Pagination jQuery Plug-in
JAVASCRIPT

Introducing the Quick Pagination jQuery Plug-in


In this first part of a three-part series, I provide you with a brief introduction to using the main features offered by the Quick Pagination jQuery plug-in. You'll appreciate many of its features, particularly its flat learning curve.

Author Info:
By: Alejandro Gervasio
Rating: 5 stars5 stars5 stars5 stars5 stars / 1
December 18, 2009
TABLE OF CONTENTS:
  1. · Introducing the Quick Pagination jQuery Plug-in
  2. · Setting the stage for the Quick Pagination jQuery plug-in
  3. · Adding behavior with the Quick Pagination jQuery plug-in
  4. · Finishing the example

print this article
SEARCH DEVARTICLES

TOOLS YOU CAN USE

advertisement
Introducing the Quick Pagination jQuery Plug-in - Setting the stage for the Quick Pagination jQuery plug-in
(Page 2 of 4 )

Since my purpose here is to demonstrate how to use the Quick Pagination plug-in with a decent variety of HTML elements, first I’m going to develop an example that will show how to use the plug-in for paginating a bunch of paragraphs with minor effort.

Having explained my plan, now it’s time to write some functional code, right? So, here’s the sample web page that I’m going to use for putting the plug-in into action. Look at its definition, please:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>jQuery Quick Pagination using paragraphs and the showcounter parameter</title>

<style type="text/css">

body {

padding: 0;

margin: 0;

background: #fff;

font: 1em Arial, Helvetica, sans-serif;

color: #000;

}

#wrapper {

width: 960px;

margin: 0 auto;

background: #f0f0f0;

}

#header, #content, #footer {

padding: 30px;

}

</style>

</head>

<body>

<div id="wrapper">

<div id="header">

<h1>jQuery Quick Pagination using paragraphs</h1>

<h2>Header section</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

</div>

<div id="content">

<h2>Main content section</h2>

<div id="datacontainer">

<p>This is the first paragraph that will be paginated with Quick Pagination jQuery plug-in.</p>

<p>This is the second paragraph that will be paginated with Quick Pagination jQuery plug-in.</p>

<p>This is the third paragraph that will be paginated with Quick Pagination jQuery plug-in.</p>

<p>This is the fourth paragraph that will be paginated with Quick Pagination jQuery plug-in.</p>

<p>This is the fifth paragraph that will be paginated with Quick Pagination jQuery plug-in.</p>

</div>

</div>

<div id="footer">

<h2>Footer section</h2>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse auctor commodo risus, et ultrices sapien vestibulum non. Maecenas scelerisque quam a nulla mattis tincidunt. Etiam massa libero, pharetra vel laoreet et, ultrices non leo. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

</div>

</div>

</body>

</html>

As you can see, this sample XHTML document is composed of the classic header, main content and footer sections, which have been provided with a basic visual style. So far, this shows nothing particularly interesting, except for the fact that the content area has an inner div identified as “datacontainer,” which includes a group of paragraphs.

As you’ll realize, if the page is tested in its current state, the paragraphs will be displayed in one row down the page, following the normal rendering flow. However, there will be cases where text displayed in the form of paragraphs, lists, and so forth will be pulled directly from a database, which requires the implementation of a pagination mechanism to make the whole navigation process friendlier and more accessible.

Here’s where the Quick Pagination plug-in comes into play. It can be used for reorganizing the previous paragraphs in nicely paginated chunks, instead of forcing you to have a monolithic block of text.

Thus, now that the previous paragraphs are ready to be used with the Quick Pagination plug-in, in the next section I’m going to create a small segment of JavaScript code that will put the plug-in to work.

To see how this will be done, click on the link below and keep reading.


blog comments powered by Disqus
JAVASCRIPT ARTICLES

- More Top jQuery Tutorials for Beginners
- More Top jQuery Plugins for Menus
- Top jQuery Tutorials for Beginners
- New UI Framework and SDK for JavaScript Rele...
- JavaScript OpenPGP Tool, Node.js 0.6.3 Avail...
- Yahoo Releases Cocktails Language and Develo...
- Customizing jQuery Slideshows: Dynamic Contr...
- Customizing jQuery Slideshows: the animate()...
- Customizing jQuery Slideshows: slideUp() and...
- Customizing jQuery Slideshows: hide() and sh...
- Web Workers: Performing Calculations in Para...
- More Top JavaScript Frameworks and Libraries
- More Dynamic jQuery Styling Techniques
- The Top JavaScript Libraries
- The Top JavaScript Frameworks

Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 



© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials