Método jQuery Effect fadeOut()

❮ Métodos de Efeito jQuery

Exemplo

Apague todos os elementos <p>:

$("button").click(function(){
  $("p").fadeOut();
});

Definição e uso

O método fadeOut() altera gradualmente a opacidade, para elementos selecionados, de visível para oculto (efeito de desvanecimento).

Nota : Elementos ocultos não serão exibidos (não afetam mais o layout da página).

Dica: Este método é frequentemente usado em conjunto com o método fadeIn() .

Sintaxe

$(selector).fadeOut(speed,easing,callback)

Parameter Description
speed Optional. Specifies the speed of the fading effect. Default value is 400 milliseconds

Possible values:

  • milliseconds
  • "slow"
  • "fast"
easing Optional. Specifies the speed of the element in different points of the animation. Default value is "swing"

Possible values:

  • "swing" - moves slower at the beginning/end, but faster in the middle
  • "linear" - moves in a constant speed
Tip: More easing functions are available in external plugins
callback Optional. A function to be executed after the fadeOut() method is completed

To learn more about callback, visit our jQuery Callback chapter


Experimente você mesmo - Exemplos


de velocidade Como usar o parâmetro de velocidade para especificar a velocidade do efeito de desvanecimento.


Como usar o parâmetro callback ao alterar gradualmente a opacidade dos elementos selecionados.


❮ Métodos de Efeito jQuery