show()

A Sniper method to show hidden elements

Typical syntax:

 $(selector).show(delay,callback);

Parameters are optional:

  • delay - the amout of time in milliseconds to wait before showing the hidden element

  • callback - A callback function is executed after the current effect is finished.

$("#mydiv").show();  //this will show the selected hidden element

Show with delay

$("#mydiv").show(3000);  //this will wait for 3 secs before showing the hidden the element

Show with a callback function

$("button").click(function(){
  $("p").show(5000, function(){
    alert("The hidden paragraph is now showing");
  });
});

Hide multiple elements

$("ul li*").show(); //this will show all the hidden list items in the ul

Last updated