0
的旋转木马我有这样的代码:我怎样才能使这个代码
initPrevNextButtons: function() {
$('.link-prev', this.$node).click(this.prev.bind(this)).hide();
$('.link-next', this.$node).click(this.next.bind(this));
},
prev: function(e) {
e.preventDefault();
this.currentPage--;
$('.link-next', this.$node).show();
if (this.currentPage <= 0) {
this.currentPage = 0;
$('.link-prev', this.$node).hide();
} else {
$('.link-prev', this.$node).show();
};
var url = this.generateURL(true);
$.get(url, this.write.bind(this));
},
next: function(e) {
e.preventDefault();
this.currentPage++;
$('.link-prev', this.$node).show();
if (this.currentPage >= this.totalItems - 1) {
this.currentPage = this.totalItems - 1;
$('.link-next', this.$node).hide();
} else {
$('.link-next', this.$node).show();
};
var url = this.generateURL(true);
$.get(url, this.write.bind(this));
},
我有一个转盘。并可以点击左侧和右侧。但是,当我在左边的项目。左边的按钮将被隐藏。当我在右边的结尾。右键将被隐藏。但是我怎么能做这个代码。我有一个旋转木马?