Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

pagination

Posted on 2009-04-06
4
Medium Priority
?
620 Views
Last Modified: 2012-05-06

its a pagination in jquery. i need to change the format of the pagination display
from 1/14 to 1,2,3,4...14. pl suggest.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
		<script src="http://projects.allmarkedup.com/jquery_quick_paginate/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://projects.allmarkedup.com/jquery_quick_paginate/jquery.quickpaginate.packed.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript" charset="utf-8">
			$(function(){
				$("#shopping_list li").quickpaginate({ perpage: 3, pager : $("#shopping_list_counter") });
			});
		</script>	
		<style>
			.qp_counter {
				margin:  10px;
			}
			pre {
				margin: 20px 0 10px 0;
				background: #ccc !important;
				padding: 10px;
			}			
			a.qp_disabled {
				color: #888;
			}
		</style>
</head>
<body>
<ul id="shopping_list">
	<li>carrots</li>
	<li>beef</li>
	<li>pineapple</li>
	<li>tofu</li>
	<li>lettuce</li>
	<li>washing up liquid</li>
	<li>yoghurt</li>
	<li>chocolate</li>
	<li>milk</li>
	<li>bread</li>
	<li>carrots</li>
	<li>beef</li>
	<li>pineapple</li>
	<li>tofu</li>
	<li>lettuce</li>
	<li>washing up liquid</li>
	<li>yoghurt</li>
	<li>chocolate</li>
	<li>milk</li>
	<li>bread</li>
	<li>carrots</li>
	<li>beef</li>
	<li>pineapple</li>
	<li>tofu</li>
	<li>lettuce</li>
	<li>washing up liquid</li>
	<li>yoghurt</li>
	<li>chocolate</li>
	<li>milk</li>
	<li>bread</li>
	<li>carrots</li>
	<li>beef</li>
	<li>pineapple</li>
	<li>tofu</li>
	<li>lettuce</li>
	<li>washing up liquid</li>
	<li>yoghurt</li>
	<li>chocolate</li>
	<li>milk</li>
	<li>bread</li>
</ul>
<div id="shopping_list_counter"></div>
</body>
</html>

Open in new window

0
Comment
Question by:vidhubala
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 5

Accepted Solution

by:
prokvk earned 2000 total points
ID: 24091951
Try this:



<!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" xml:lang="en" lang="en">
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
                <script src="http://projects.allmarkedup.com/jquery_quick_paginate/jquery-1.2.6.min.js" type="text/javascript" charset="utf-8"></script>
                <script src="http://projects.allmarkedup.com/jquery_quick_paginate/jquery.quickpaginate.packed.js" type="text/javascript" charset="utf-8"></script>
                <script type="text/javascript" charset="utf-8">
                        $(function(){
                                $("#shopping_list li").quickpaginate({ perpage: 3, pager : $("#shopping_list_counter") });
                                
                                //alert($('span.qp_counter').html());
                                
                                var qp = $('span.qp_pagenumber').text();
                                
                                $('span.qp_counter').html('<span class="qp_pagenumber">' + qp + '</span>');
                        });
                </script>       
                <style>
                        .qp_counter {
                                margin:  10px;
                        }
                        pre {
                                margin: 20px 0 10px 0;
                                background: #ccc !important;
                                padding: 10px;
                        }                       
                        a.qp_disabled {
                                color: #888;
                        }
                </style>
</head>
<body>
<ul id="shopping_list">
        <li>carrots</li>
        <li>beef</li>
        <li>pineapple</li>
        <li>tofu</li>
        <li>lettuce</li>
        <li>washing up liquid</li>
        <li>yoghurt</li>
        <li>chocolate</li>
        <li>milk</li>
        <li>bread</li>
        <li>carrots</li>
        <li>beef</li>
        <li>pineapple</li>
        <li>tofu</li>
        <li>lettuce</li>
        <li>washing up liquid</li>
        <li>yoghurt</li>
        <li>chocolate</li>
        <li>milk</li>
        <li>bread</li>
        <li>carrots</li>
        <li>beef</li>
        <li>pineapple</li>
        <li>tofu</li>
        <li>lettuce</li>
        <li>washing up liquid</li>
        <li>yoghurt</li>
        <li>chocolate</li>
        <li>milk</li>
        <li>bread</li>
        <li>carrots</li>
        <li>beef</li>
        <li>pineapple</li>
        <li>tofu</li>
        <li>lettuce</li>
        <li>washing up liquid</li>
        <li>yoghurt</li>
        <li>chocolate</li>
        <li>milk</li>
        <li>bread</li>
</ul>
<div id="shopping_list_counter"></div>
</body>
</html>

Open in new window

0
 

Author Comment

by:vidhubala
ID: 24092413
thanks, need to see all the pagenumbers at the same time like 1 2 3 ... 10.
0
 
LVL 5

Expert Comment

by:prokvk
ID: 24092439
Well, I'm afraid that's way beyond this plugin .. This plugin allows you to display current page and provides the functionality you've seen ... Can't help you there
0
 

Author Comment

by:vidhubala
ID: 24264497
thanks. will wait for some more answers before closing it.
0

Featured Post

Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The most up-to-date version of this article is on my Blog https://iconoun.com/blog/
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses

661 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question