...

Library - JQuery

Back to Course

Lesson Description


Lession - #564 JQuery Callback


A callback function could be a function that is executed once the effect is complete. The callback function is passed as an argument to the effect methods and that they typically appear as the last argument of the method.

Syntax

 $(selector>
.hide(speed,callback>
;


Example


<html>  
<head> 
 <title> jQuery Example</title>  
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">  
 <script>  
 $(document>
.ready(function(>
{ $("button">
.click(function(>
{ $("p">
.hide("slow", function(>
{ alert("The paragraph is now hidden">
; }>
; }>
; }>
; </script> </head> <body> <button>Hide</button> <p>techedhub.com</p> </body> </html>
Try it here