English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
hide() method to hide the selected elements.
This method is usually used withshow()methods are used together.
Note:Hidden elements no longer affect the page layout.
$$(selector).hide(duration, easing, callback)
This example hides paragraphs on the page when the page is clicked:
$$("p").click(function(){ $$(this).hide(); });Teste e veja‹/›
Hide all <p> elements when the button is clicked:
$$("button").click(function(){ $$("p").hide(); });Teste e veja‹/›
UsingdurationParameters:
$$("button").click(function(){ $$("p").hide(1000); });Teste e veja‹/›
UsingcallbackParameters:
$$("button").click(function(){ $$("div").hide(1000, function(){ alert("DIV is hidden"); }); });Teste e veja‹/›
Animation all spans (in this case, words) are hidden quickly, in200 milliseconds to complete each animation:
$$("button").click(function(){ $$("span:last-child").hide("fast", function(){ $$(this).prev().hide("fast", arguments.callee); }); });Teste e veja‹/›
Clique além2Segundos ocultar o elemento span, e então excluir o elemento span ao ocultar:
$("span").click(function(){ $(this).hide(2000, function(){ $(this).remove(); }); });Teste e veja‹/›
Parâmetro | Descrição |
---|---|
duration | (Opcional)Determina quanto tempo o efeito de ocultamento deve durar. O valor padrão é400 milissegundos Valores Possíveis:
|
easing | (Opcional)Uma string que especifica a velocidade do elemento em diferentes pontos da animação. O valor padrão é “swing” Valores Possíveis:
|
callback | (Opcional)Função chamada após a conclusão do método hide(), chamada uma vez para cada elemento selecionado |