jQuery Tutorial


jQuery Example


jQuery References


jQuery toggle() Effect Reference


  All jQuery Effect References


Uses

jQuery toggle() effect method run between hide() and show() effect for selected elements.


Syntax

$(selector).toggle(speed,[callback])

jQuery toggle() effect supported following parameters.

ParameterDescription
speed speed is Optional parameter. speed define hide the effect.
Specific Speed Values:
  • "slow"
  • "normal"
  • "fast"
  • "1000" (milliseconds)
callback Callback is optional parameter. It is use to represents a function to be executed whenever effect is completed.

jQuery toggle() effect Example

<script type="text/javascript"> 
$(document).ready(function(){
      $("p").hide();	
    $("#btn1").click(function () {
      $("p").toggle("slow");
    });
});
<script>
Online Try This Code Your Self....   »

  All jQuery Effect References