1

I want to add custom text in front of jQuery pagination plugin

we got like following in JQuery pagination plugin

  |<    <  1/23   >  >|

I want to add text before it like following:

   Page: |<    <  1/23   >  >|

I want like second format. How can I get it? Anybody know how to get the "div" id in that control too?

Gilles 'SO- stop being evil'
  • 104,111
  • 38
  • 209
  • 254
RedsDevils
  • 1,413
  • 9
  • 26
  • 47

1 Answers1

1

The script at http://plugins.jquery.com/project/jquery-pagination has been packed, so I went to download the unpacked version at http://rohitsengar.cueblocks.net/jquery-pagination-plugin/.

Scroll to the bottom of the script and look for:

$(".paginator").html(style);

and change it to:

$(".paginator").html('<span>Page: </span>' + style);
Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
  • I use this one http://plugins.jquery.com/project/jquery-pagination and I can't find the words you mentioned. – RedsDevils Jun 24 '11 at 07:08
  • Hi Samuel, it work with initPaginator(); $('.paginator').prepend('Page: '); but if navigate , the text disappear. so How can I fix that? – RedsDevils Jun 24 '11 at 08:55
  • that's replace all navigation part. – RedsDevils Jun 24 '11 at 09:27
  • When I add this line $(".paginator").html('Page: ' + style); it shows 2 lines of Page: |< < 1/23 > >| and at second page "Page:" is missed and it shows 2 lines of |< < 1/23 > >| – RedsDevils Jun 25 '11 at 05:46
  • 1
    Thanks Samuel , Now I got it! I use this .paginator:before{ content:"Page";font-family:@Arial;font-size:13px;} – RedsDevils Jun 26 '11 at 16:13
  • :before pseudo isn't support for IE7 so I have to use these code for IE7 – RedsDevils Jun 30 '11 at 08:20