A Better Page Navigation Script with MooTools

A Better Page Navigation Script with MooTools

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...
538 views

It is only a little script that can turn your ugly looking numbers into a nice looking Slider and quite frankly, MooTools does most of the work for us already.They have also packed up a little example in PHP to see how you can integrate this script in you

The problem with that implementation usually is that you don’t want to go to any other page than the “next” or “previous” one. Especially with search results: looking at page 5 or 6 when you haven’t seen pages 2-4 doesn’t make any sense as the search results most probably are even less what you are searching for. This also applies to digg or to any blog, unless you are specifically searching for a page because you >know< where you will find a specific entry. But even then, page 42 typically isn't on the list.

What does the user want?

Well, I think by the time we have agreed that the Pagination system as we find it on most websites today sucks and just “gets the job done”. Clicking through the next or previous page normally is enough and pagination systems really get ugly when showing off like “1, 2, 3, 4 … 679, 680, 681 … 1021, 1022, 1023″.

And you say you can make pagination more awesome?

This for sure depends on your point of view but you can try going to the index page of this portfolio and scroll to the bottom or just view the

The CSS:

   1. div.paginate {
   2.   line-height: 23px;
   3. }
   4.
   5. div.slider {
   6.   width: 180px;
   7.   height: 22px;
   8.   float: left;
   9.   margin: 2px 5px;
  10.   cursor: pointer;
  11.   background: url('Slider.png') center center no-repeat;
  12. }
  13.
  14. div.knob {
  15.   width: 22px;
  16.   height: 22px;
  17.   cursor: pointer;
  18.   background: url('Knob.png') no-repeat;
  19. }
  20.
  21. div.knob:hover {
  22.   background-position: 0 -22px;
  23. }
  24.
  25. span.current {
  26.   font-weight: bold;
  27. } 

div.paginate {
  line-height: 23px;
}

div.slider {
  width: 180px;
  height: 22px;
  float: left;
  margin: 2px 5px;
  cursor: pointer;
  background: url('Slider.png') center center no-repeat;
}

div.knob {
  width: 22px;
  height: 22px;
  cursor: pointer;
  background: url('Knob.png') no-repeat;
}

div.knob:hover {
  background-position: 0 -22px;
}

span.current {
  font-weight: bold;
}

The HTML (Example) – This is what your code should generate

   1. <div class="paginate">
   2.   <a href="index.php?start={start}" class="link" style="display: none;">11</a>
   3.   <span class="per" style="display: none;">5</span>
   4.   <div class="slider"><div class="knob" title="Drag me to go to the desired page"></div></div>
   5.   <span style="float: left;">Page <span class="current">2</span> of 11</span>
   6. </div> 

Demo: http://og5.net/christoph/article/A_better_Pagination

Download: http://og5.net/christoph/Scripts/Pagination/Pagination.zip

Source: http://og5.net/christoph/article/A_better_Pagination

http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/delicious_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/blinklist_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/furl_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/technorati_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/magnolia_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/google_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/myspace_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/facebook_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/sphinn_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/mixx_32.png http://www.ajaxupdates.com/wp-content/plugins/sociofluid/images/twitter_32.png

Related Listings:

  1. Create a Sprited Navigation Menu Using CSS and MooTools CSS sprites are all the rage these days. And why...
  2. iPhone Checkboxes Using MooTools One of the sweet user interface enhancements provided by Apple’s...
  3. Page Peel Effect Using MooTools A great script back in May titled Simple Page Peel...
  4. Get Slick Effects with MooTools Kwicks When it came time for my employer to redo their...
  5. Animated Navigation with CSS & jQuery The simple and elegant roll over effects that I liked....

Do you like this post?

Email:     

Tags: , , , , ,

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment



Web Design & CSS (Templates) - TOP.ORG