我正在使用这个 jQuery 幻灯片插件,并尝试通过将数字放在圆圈中来自定义分页按钮。我最终制作了一个带有 4 个圆圈的精灵来执行此操作。
它目前适用于 1 按钮,但我不确定如何显示数字 2-4。 这是带有一些代码的 JSfiddle(下面还有一些 CSS)。我想我在这一点上逻辑上卡住了。任何建议都会很棒。.
.slidesjs-pagination li a {
display: block;
width: 102px;
height: 0;
padding-top: 102px;
background-image: url(img/buttons.png);
background-position: 0 0;
float: left;
overflow: hidden;
}
.slidesjs-pagination li a.active,
.slidesjs-pagination li a:hover.active {
background-position: 0 -102px;
}
.slidesjs-pagination li a:hover {
background-position: 0 -204px;
}
/* Don't worry much about this jQuery, I found it in the plugin, it seems to be
producing the number based on how many images there are. Although this isn't what
I want to do anymore, since I know I have 4 images. */
if (this.options.pagination.active) {
i = e("<ul>", {
"class": "slidesjs-pagination"
}).appendTo(n);
e.each(new Array(this.data.total), function (t) {
var n, r;
n = e("<li>", {
"class": "slidesjs-pagination-item"
}).appendTo(i);
r = e("<a>", {
href: "#",
"data-slidesjs-item": t,
html: t + 1
}).appendTo(n);
return r.click(function (t) {
t.preventDefault();
a.stop(!0);
return a.goto(e(t.currentTarget).attr("data-slidesjs-item") * 1 + 1)
})
})
}