Today, I want to share with you a very special CSS3 paging plug-in. This paging plug-in not only enables paging by clicking the paging button, but also allows you to slide the slider to redirect any page, it looks cool and is suitable for some personalized personal websites. Of course, this paging plug-in is also suitable for ajax paging, and the results are quite good. Let's take a look:
It's cool.
.
Next, let's share the Implementation ideas of the source code. Here we use the jQuery UI framework. Such a cool slide is implemented by it. Otherwise, the writing will be exhausted ..
The first is the HTML code:
Previous Page Next Page Go
Here we can see that the slider area is defined first, and then there are two paging buttons that can be turned forward and backward. Finally, there is a page number input box and a button for any page Jump.
Although this slide bar is very beautiful, it will be difficult to implement. In fact, using jQuery UI is very simple.
Next let's take a look at the CSS code:
Page flip button:
{:;:;:;:;:;:;:;:;}{:;}
Unfortunately, two arrows are used as the background. However, the effect is acceptable.
Then the input box is:
{:;:;:;:;:;:;:;:;:;:;:;:;:;}{:;:;:;:;:;:;:;:;}
Then there is the background of the slide, and the linear gradient attribute of CSS3 is used:
{:;:;:;:;:;:;:;:;:;:;}{:;:;:;:;:;:;:;:;:;:;}{:;:;:;:;:;:;:;:;:;:;:;:;}{:;:;:;:;:;:;:;}{:;:;}{:;:;}{:; }{:;:; }{:; }{:;:; }
Finally, js is used to implement the paging logic. Let's take a look:
$(document).ready( pagesMax = 30 pagesMin = 1 startPage = 7 url = "http://yoursite.com/results?page={{1}}"'.pagination .pageSlider''.pagination .pageSlider .ui-slider-handle'"aria-valuenow""aria-valuetext": "Page " +"role": "slider""aria-valuemin""aria-valuemax""aria-describedby": "pageSliderDescription"'.pagination .pageInput''slide', ( event.metaKey ||( ui.value > $().slider('value'( ui.value+9 < pagesMax ) { ui.value+=9 { ui.value=).slider('value'( ui.value-9 > pagesMin ) { ui.value-=9 { ui.value=).slider('value''.pagination .pageNumber span''.pagination .pageInput''slidechange', '.pagination .pageNumber''role','alert''span''.pagination .pageInput''.pagination .pageSlider .ui-slider-handle'"aria-valuenow""aria-valuetext": "Page " +'.pagination .pageSlider .ui-slider-handle').on( 'keyup' , ( e.which == 13 curPage = $('.pagination .pageSlider').slider('value''we would now send you to: ' + url.replace( /{{.}}/'.pagination .pageInput').on( 'change' , '.pagination .pageSlider').slider( 'value', $('.pageSkip').on('click', $ = $(( $.hasClass('pageNext' curPage = $('.pagination .pageSlider').slider('value')+1 ( $.hasClass('pagePrev' curPage = $('.pagination .pageSlider').slider('value')-1'.pagination .pageSlider').slider('value'= setTimeout( 'we would now send you to: ' + url.replace( /{{.}}/1000 pips = max- $pagination = $('.pagination .pageSlider'( i=0; i<=pips; i++ s = $('<span class="pagePip"/>''' + (100/pips)*i + '%' minPip = $('<span class="pageMinPip">'+min+'</span>' maxPip = $('<span class="pageMaxPip">'+max+'</span>''.pagination .ui-slider-handle''<span class="pageNumber">Page <span>' +'.pagination .pageSlider').slider('value') + '</span></span>''.pagination .pageButton').on('click', curPage = $('.pagination .pageSlider').slider('value''we would now send you to: ' +/{{.}}/
The code can be expanded by yourself. In addition, similar to this paging plug-in, there is also a exquisite jQuery paging plug-in with slide pages. It also has a slide bar, but I personally think it is not so cool, huh, huh.
Finally, package the source code,>