Paginator3000 and mouse wheel
It took one day to implement a pager pagination a la child .
I didn’t go far into the woods, but decided to find what kind of beast was it that was so excavated at many sites, but it turned out to be the brainchild of karaboz . And there is even an analog converted to jQuery.
But each version has, as it seemed to me, a huge flaw, ignoring the mouse wheel. “But it would be more convenient with that!” I exclaimed and decided to rewrite it a bit so that the pager would scroll to the mousewheel event. And also there are other shortcomings that I will cover under the cut.
No sooner said than done.
See an example .
Download the fixed version (independent of jQuery).
Image for clarity:
Application method: Minuses : 1. jQuery version Binding and dependence on jQuery, and also does not work on clicking on a scrollbar. But they have a bunch of "goodies" in the form of additional parameters - the function being called in instead of navigating to the URL, the reverse order of output. 2. The original version. Lack of the above described "goodies", but they do not interfere with life. I hope that they won’t throw me tomatoes for such a rash step. Moreover, the author of the jQuery version promised to hang this event, but probably did not find the time. It will be great if this pager appears in children - it is impossible to reach the futuriko by mail. Or if I get a cherished invite for children. PS
. If you will be in demand "buns" jQuery-version, write - I will bring them.
I didn’t go far into the woods, but decided to find what kind of beast was it that was so excavated at many sites, but it turned out to be the brainchild of karaboz . And there is even an analog converted to jQuery.
But each version has, as it seemed to me, a huge flaw, ignoring the mouse wheel. “But it would be more convenient with that!” I exclaimed and decided to rewrite it a bit so that the pager would scroll to the mousewheel event. And also there are other shortcomings that I will cover under the cut.
No sooner said than done.
See an example .
Download the fixed version (independent of jQuery).
Image for clarity:
Application method: Minuses : 1. jQuery version Binding and dependence on jQuery, and also does not work on clicking on a scrollbar. But they have a bunch of "goodies" in the form of additional parameters - the function being called in instead of navigating to the URL, the reverse order of output. 2. The original version. Lack of the above described "goodies", but they do not interfere with life. I hope that they won’t throw me tomatoes for such a rash step. Moreover, the author of the jQuery version promised to hang this event, but probably did not find the time. It will be great if this pager appears in children - it is impossible to reach the futuriko by mail. Or if I get a cherished invite for children. PS
paginator_example = new Paginator(
"paginator_example", // id контейнера, куда ляжет пагинатор
2048, // общее число страниц
10, // число страниц, видимых одновременно
300, // номер текущей страницы
"http://www.yourwebsite.com/pages/". // url страниц также можно «page-%page%.html», где %page% вставляемый номер страницы
false // необязательный параметр, если true, то обратный вывод
);
. If you will be in demand "buns" jQuery-version, write - I will bring them.
UPD : updated the code of the js-file, in accordance with the current version of dirty.ru - easier and with the handlers "ctrl + →" and "ctrl + ←".
UPD : added the ability to reverse the output order of pages.