Conflict between CSS transition and jQuery fade

前端 未结 3 1272
一整个雨季
一整个雨季 2021-01-13 09:31

I\'m trying to create a tiled wall with a little menu to display: none some elements based on their class. In my CSS I have CSS transitions which are causing

3条回答
  •  忘掉有多难
    2021-01-13 09:56

    I usually do what millimoose suggests:

    $('#cboxClose').removeClass('transEnabl').fadeIn(500, function() {
      $(this).addClass('transEnabl'); 
    });
    

    Where transEnabl is something like:

    .transEnabl {
      transition: all 0.3s linear;
    }
    

    It is ugly as hell, but it works. The problem comes because css transitions are giving a duration on the execution of the opacity.

提交回复
热议问题