Fade to with callback function
Description
The following code shows how to fade to and call a function.
Example
<html>
<head>
<script
src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {<!-- w ww. j a v a 2 s . co m-->
$("div").fadeTo(250, Math.random(), function() {
alert("done");
});
});
</script>
</head>
<body>
<div>Click me. Java2s.com</div>
</body>
</html>