O'Reilly logo

jQuery and JavaScript Phrasebook by Brad Dayley

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating show()

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

The .show( [duration] [, easing] [, callback]) method provides the optional duration, easing, and callback options, allowing you to animate the show effect and make an easier transition as an element appears.

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

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required