Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.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
为什么当我快速单击箭头控件图标时,jQuery滑块消失了?_Jquery_Html_Css - Fatal编程技术网

为什么当我快速单击箭头控件图标时,jQuery滑块消失了?

为什么当我快速单击箭头控件图标时,jQuery滑块消失了?,jquery,html,css,Jquery,Html,Css,我在jquery滑块中遇到了一些疯狂的问题 当我慢慢单击箭头控件时,效果非常好 但是,当我快速单击任何箭头控件时,整个div部分将消失,但它仍然存在于源代码中 你能帮我解决这个问题吗 完整代码如下: //检查推荐信 var leftArrow=$('.estimational.fa chevron left'), rightArrow=$('.estimonials.fa-chevron-right'); 函数checkClients(){ if($('.client:first').hasC

我在jquery滑块中遇到了一些疯狂的问题

当我慢慢单击箭头控件时,效果非常好

但是,当我快速单击任何箭头控件时,整个div部分将消失,但它仍然存在于源代码中

你能帮我解决这个问题吗

完整代码如下:

//检查推荐信
var leftArrow=$('.estimational.fa chevron left'),
rightArrow=$('.estimonials.fa-chevron-right');
函数checkClients(){
if($('.client:first').hasClass('active')){
leftArrow.fadeOut();
}否则{
leftArrow.fadeIn();
}
if($('.client:last').hasClass('active')){
右箭头。淡出();
}否则{
rightArrow.fadeIn();
}
}
checkClients();
$('.commentialsi')。单击(函数(){
if($(this).hasClass('fa-chevron-right')){
$('.essentials.active').fadeOut(400,function(){
$(this.removeClass('active').next('.client').addClass('active').fadeIn();
checkClients();
});
}否则{
$('.essentials.active').fadeOut(400,function(){
$(this.removeClass('active').prev('.client').addClass('active').fadeIn();
checkClients();
});
}
});
。推荐信{
背景:url('../images/essentials.jpg');
-webkit背景尺寸:封面;
-moz背景尺寸:封面;
背景尺寸:封面;
}
.推荐信.委托人{
填充:50px0;
颜色:#FFF;
字体大小:20px;
}
.推荐书.客户img{
边界半径:50%;
宽度:100px;
高度:100px;
}
.推荐信客户p{
线高:2;
字体:斜体;
}
.推荐信。右前V字形,
.推荐信。左前V字形{
位置:绝对位置;
最高:50%;
颜色:#FFF;
光标:指针;
-webkit过渡:所有.3s易于输入输出;
-moz转换:所有.3轻松输入输出;
-o型转换:所有.3s易于输入输出;
过渡:所有.3s易于输入输出;
}
.推荐信。左V字形:悬停,
.推荐。左前V形:悬停{
颜色:#F760E;
}
.推荐信.左V字形{
右:0;
}
.推荐信。左前V字形{
左:0;
}


这些家伙真是不可思议!我在10天内完成了我的项目,真是太棒了!

服务很好!强烈推荐!

约翰·史密斯 这些家伙真是不可思议!我在10天内完成了我的项目,真是太棒了!
服务很好!强烈推荐!

瓦埃尔·阿萨夫 这些家伙真是不可思议!我在10天内完成了我的项目,真是太棒了!
服务很好!强烈推荐!

索菲亚·贝达尔 这些家伙真是不可思议!我在10天内完成了我的项目,真是太棒了!
服务很好!强烈推荐!

塔塔
您有一个额外的});在那里,我认为这可能是造成问题的原因

$('.testimonials i').click(function() {


if ($(this).hasClass('fa-chevron-right')) {
    $('.testimonials .active').fadeOut(400, function() {
      $(this).removeClass('active').next('.client').addClass('active').fadeIn();
      checkClients();
    });
  } else {
    $('.testimonials .active').fadeOut(400, function() {
      $(this).removeClass('active').prev('.client').addClass('active').fadeIn();
      checkClients();
    });
  }
});
它用于主$(函数(){})。。不过还是谢谢你