Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.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 ui 不透明度后的jquery悬停状态_Jquery Ui_Jquery_Jquery Plugins_Jquery Selectors - Fatal编程技术网

Jquery ui 不透明度后的jquery悬停状态

Jquery ui 不透明度后的jquery悬停状态,jquery-ui,jquery,jquery-plugins,jquery-selectors,Jquery Ui,Jquery,Jquery Plugins,Jquery Selectors,单击按钮后,图像不透明度会发生变化,但“重新”按钮仍会显示在悬停状态 一旦图像的不透明度改变,是否可以完全移除红色按钮 下面提供我的js代码 $(document).ready(function(){ $(".specialHoverOne").hover(function(){ // alert("i am here"); $(".ctaSpecialOne").css("visibility","vi

单击按钮后,图像不透明度会发生变化,但“重新”按钮仍会显示在悬停状态 一旦图像的不透明度改变,是否可以完全移除红色按钮

下面提供我的js代码

  $(document).ready(function(){
                  $(".specialHoverOne").hover(function(){
    //  alert("i am here");
                    $(".ctaSpecialOne").css("visibility","visible");


                    },
                    function(){
                        $(".ctaSpecialOne").css("visibility","hidden");
                  }
                  );

     $(".ctaSpecialOne").click(function(e){
                        e.preventDefault();

                        $(this).parent().prev().prev().css({'opacity':.5});    

                 }); 


                });

是的…假设.CTA是红色按钮的类

$(".ctaSpecialOne").on('click', function(){
    $(this).remove();
});
集成到您的代码中

 $(".ctaSpecialOne").click(function(e){
      e.preventDefault();
     $(this).parent().prev().prev().css({'opacity':.5});
     $(this).remove();   
 }); 
这是我通常的做法

我还建议将
.css
更改为
.animate
,然后您可以执行以下操作

$(this).parent().prev().prev().stop(true,true).animate({'opacity':.5}).delay(1).queue(function (){
    ... your code here ...
    $(this).dequeue();
});  

他要求在不透明度改变后,就这样做了。。。因此,不透明度将不会产生任何影响,因为它是多余的…不透明度会影响杂志元素…当单击按钮时,它会更改杂志的不透明度并删除按钮。很简单,哈哈,谢谢…我真的不希望在早上的第一件事就卷入一场“评论”之战(x)@VIDesignz:谢谢你的回复你的代码有可能获得这种不透明性吗works@user1828505你是说中间的标志吗?谢谢你的回答,你可以用小提琴来演示吗?
$(this).parent().prev().prev().stop(true,true).animate({'opacity':.5}).delay(1).queue(function (){
    ... your code here ...
    $(this).dequeue();
});