jquery exercises

jQuery Effect: Animates all hidden elements to show slowly

jQuery Effect: Exercise-13 with Solution

Animates all hidden elements to show slowly.
Sample Data :

HTML code:

<button>Show it</button>
<p style="display: none">Hello</p>


HTML Code :

<!DOCTYPE html>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
    background: #ECEDF3;
  <meta charset="utf-8">
  <title>Animates all hidden elements to show slowly</title>
<button>Show it</button>
<p style="display: none">Hello</p>

JavaScript Code :

$( "button" ).click(function() {
  $( "p" ).show( "slow" );

Note :
In jQuery show( [duration ] [, complete ] ) method is used to display the matched elements. It has the following parameters :

  • duration : A string or number determining how long the animation will run. [Type- Number or String]
  • complete : A function to call once the animation is complete. [Type: Function()]

Live Demo:

See the Pen jquery-effect-exercise-13 by w3resource (@w3resource) on CodePen.

Contribute your code and comments through Disqus.

Previous: Toggle animation on and off.
Next: Animates all divs to slide down and slide up.

What is the difficulty level of this exercise?

New Content: Composer: Dependency manager for PHP, R Programming