gpt4 book ai didi

jquery - 自定义分页,箭头代替下一页 上一页

转载 作者:行者123 更新时间:2023-12-03 22:43:38 28 4
gpt4 key购买 nike

我正在使用 jQuery DataTables,并且希望扩展默认分页以使用带有箭头或图像的按钮,而不是 Next Previous 文本链接。

在脚本初始化时我尝试使用

    ...
"oPaginate": {
"sNext": '<i class="entypo-right-circled" ></i>',
"sPrevious": '<i class="entypo-left-circled" class="Dia_pagination_ico" ></i>'
},
...

但我仍然有默认分页

enter image description here

最佳答案

您可以通过 language.paginate.next 自定义分页按钮标签和 language.paginate.previous .

$('#the_table').DataTable({
language: {
paginate: {
next: '&#8594;', // or '→'
previous: '&#8592;' // or '←'
}
}
});

由于 nextprevious 的值可以包含标记,因此您甚至可以使用图像或字形图标字体。

$('#the_table').DataTable({
language: {
paginate: {
next: '<img src="path/to/arrow.png">',
previous: '<i class="fa fa-fw fa-long-arrow-left">'
}
}
});

如果您想在现有文本之前或之后包含箭头,也可以使用纯 CSS:

.paginate_button.previous:before {
content: '← ';
}

.paginate_button.next:after {
content: ' →';
}

关于jquery - 自定义分页,箭头代替下一页 上一页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35178880/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com