hide, show and toggle functions in jQuery have optional callback function (used within the same parentheses), that allows to assign action after the effect is finished. For example, after something is shown or revealed, you may go to a URL or display a pop-up alert box.

Here’s an example:

<script type=”text/javascript”>
$(document).ready(function(){
$(‘:submit’).click(function () {
$(‘div’).toggle(‘slow’,
function callback() {
alert(‘The toggle is finished’)
});
});
});
</script>