0

一旦我单击按钮,图像不透明度会发生变化,但重新按钮仍然出现在悬停时,一旦图像的不透明度发生变化,是否可以完全删除红色按钮...

http://jsfiddle.net/mwPeb/11/

在下面提供我的 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});    

                 }); 


                });
4

2 回答 2

0

是的...假设 .ctaSpecialOne 是红色按钮的类...

$(".ctaSpecialOne").on('click', function(){
    $(this).remove();
});

集成到您的代码中

 $(".ctaSpecialOne").click(function(e){
      e.preventDefault();
     $(this).parent().prev().prev().css({'opacity':.5});
     $(this).remove();   
 }); 
于 2012-11-16T13:49:38.457 回答
0
$(this).parent().prev().prev().css({'opacity':.5}).stop(true,true).delay(1).queue(function (){
    ... your code here ...
    $(this).dequeue();
});  

这就是我通常的处理方式......

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

$(this).parent().prev().prev().stop(true,true).animate({'opacity':.5}).delay(1).queue(function (){
    ... your code here ...
    $(this).dequeue();
});  
于 2012-11-16T13:50:20.897 回答