缩短easypagination页面显示长度

时间:2017-04-20 06:53:45

标签: jquery css html5 pagination

我有一个代码,我使用easypagination进行分页处理,但我面临的问题是,当'elementsPerPage'属性减少到较小的数量时,分页的宽度增加但是

我希望它被限制在点之间,如: << | < | 1 | 2 | 3 | ...... | 8 | 9 | >>

目前如下: << | < | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | >>

我如何在easypagination中实现这一目标。这可能是很有帮助的。

谢谢,

我的代码在这里:

的CSS

 #easyPaginate {width:300px;}
 #easyPaginate img {display:block;margin-bottom:10px;}
.easyPaginateNav a {padding:5px;}
.easyPaginateNav a.current {font-weight:bold;text-decoration:underline;}

html的

<div id="easyPaginate">
    <img src="img/demo/surf1.jpg" />
    <img src="img/demo/surf2.jpg" />
    <img src="img/demo/surf3.jpg" />
    <img src="img/demo/surf4.jpg" />
    <img src="img/demo/surf5.jpg" />
    <img src="img/demo/surf6.jpg" />
    <img src="img/demo/surf7.jpg" />
    <img src="img/demo/surf8.jpg" />
    <img src="img/demo/surf9.jpg" />
    <img src="img/demo/surf10.jpg" />
    <img src="img/demo/surf11.jpg" />
    <img src="img/demo/surf12.jpg" />
    <img src="img/demo/surf13.jpg" />
    <img src="img/demo/surf14.jpg" />
    <img src="img/demo/surf15.jpg" />
    <img src="img/demo/surf16.jpg" />
    <img src="img/demo/surf17.jpg" />
    <img src="img/demo/surf18.jpg" />
</div>

的.js

$('#easyPaginate').easyPaginate({
    paginateElement: 'img',
    elementsPerPage: 3,
    effect: 'climb'
});

1 个答案:

答案 0 :(得分:0)