What is a callback function in jQuery and why is it needed in effects?
<div id="b">Box</div>
$('#b').hide(300, function () {
console.log('2. callback: effect finished');
});
console.log('1. this runs immediately after starting the effect');
Console output
2. callback: effect finished
1. this runs immediately after starting the effect
See Method Chaining and Callbacks.
Learn more about the similar topics:
| Tutorials |
|---|
| No Content Found. |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |