我有这样的代码:
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));
},
我有一个旋转木马。并且可以点击左右。但是当我在左边的项目,左键将被隐藏。当我在右边的时候,右边的按钮也会被隐藏起来。但是我怎样才能写出这些代码。我有一个旋转木马? 我从你的话中理解的是,当你将鼠标移动到它们上面时,你的下一个/上一个图标会隐藏起来。清单上有多少项?
尝试注释以下行并运行应用程序
$('.link-next', this.$node).hide();
$('.link-prev', this.$node).hide();
不要删除,只是评论它们,看看你是否能看到下一个/上一个图标?