Animating hide()

$("#box").hide(1000, "linear", function() {   $("#label").html("Hidden!") });

The .hide( [duration] [, easing] [, callback]) method provides the optional duration, easing, and callback options allowing you to animate the hide effect, making less of a jump when the element disappears.

For example, the following code applies an animation of 1 second with linear easing and executes a simple callback function when hiding an element:

$("#box").hide(1000, "linear", function() {    $("#label").html("Hidden!") });

Get jQuery and JavaScript Phrasebook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.