Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/476.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我怎样才能把这段代码做成旋转木马呢_Javascript_Jquery_Carousel - Fatal编程技术网

Javascript 我怎样才能把这段代码做成旋转木马呢

Javascript 我怎样才能把这段代码做成旋转木马呢,javascript,jquery,carousel,Javascript,Jquery,Carousel,我有以下代码: initPrevNextButtons: function() { $('.link-prev', this.$node).click(this.prev.bind(this)).hide(); $('.link-next', this.$node).click(this.next.bind(this)); }, prev: function(e) {

我有以下代码:

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));
            },
initprevenxtbuttons:function(){
$('.link prev',this.$节点)。单击(this.prev.bind(this)).hide();
$('.link next',this.$节点)。单击(this.next.bind(this));
},
上一页:功能(e){
e、 预防默认值();
此.currentPage--;
$('.link next',this.$node.show();
if(this.currentPage=this.totalItems-1){
this.currentPage=this.totalItems-1;
$('.link next',this.$node.hide();
}否则{
$('.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();
不要删除,只需对它们进行注释,看看是否可以看到下一个/上一个图标