The .fadeOut() method to use visibility property instead of display property

前端 未结 3 788
抹茶落季
抹茶落季 2020-12-03 11:16

The .fadeOut() method animates the opacity of the matched elements. Once the opacity reaches 0, the display style property is set to none, so the element no longer affects

3条回答
  •  没有蜡笔的小新
    2020-12-03 11:49

    Just Overwrite the property in the call back

    $('Element').on("click", function() {
        $(this).fadeOut(500, function() {
            $(this).css({"display": "block","visibility": "hidden"});  // <-- Style Overwrite 
        }); 
    })​
    

提交回复
热议问题