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:The hidden elements will no longer affect the layout of the page.
$$(selector).hide(duration, easing, callback)
This example hides paragraphs on the page when the page is clicked:
$$("p").click(function(){ $$(this).hide(); });Test to see‹/›
Hide all <p> elements when the button is clicked:
$$("button").click(function(){ $$("p").hide(); });Test to see‹/›
UsingdurationParameters:
$$("button").click(function(){ $$("p").hide(1000); });Test to see‹/›
UsingcallbackParameters:
$$("button").click(function(){ $$("div").hide(1000, function(){ alert("DIV is hidden"); }); });Test to see‹/›
All spans of animation (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); }); });Test to see‹/›
Click more than2Seconds, hide the span element and then remove the span element when hiding:
$("span").click(function() { $(this).hide(2(e.g., 1000, 2000, etc.), function() { $(this).remove(); }); });Test to see‹/›
Parameter | Description |
---|---|
duration | Optional: The duration for which the hide effect will run. The preset value is400 milliseconds Possible values:
|
easing | Optional: A string that specifies the speed of the element at different points in the animation. The default value is "swing" Possible values:
|
callback | Optional: The function called after the hide() method completes, called once for each selected element |