Hello and welcome to this chick query video on corbat functions.
But volunteers are used to prevent kord executing too early.
They are usually used with animations or that you query effects.
So what the call above about function does it holds back the next line of code from executing on till
the current effect or animation is completely finished.
If they call about function is not included in the code.
It may cause the next line of code to execute.
Pretty much surely before the animation or effect has completed this can sometimes create errors in
the application or could swear by a corbat function is specified.
It will only execute after the corette effect or animation is completed.
I have called my editor of course some piece of code here.
So in between the script tag I have caught some Gick query function.
So the there's line near Line 6.
We've got the documents already function which gets the document ready.
Make sure the page is ready fully could execute and then onli sermon.
We've got the button as a selector.
There is a button here saw when the button is clear.
Tom I have a tidy click handler to the button so when the button is clicked it will fire up an action.
The action that will call will call on another selector which is the diff.
Deep here so any button is click the div wall height and add it all high because I specified a taut
height event here I am.
So don't hide look.
Hide the Deve when the botanist clicked on.
Also inside the hide function I have specified a parameter.
The first time it passed it is slow.
I wanted to hide the button do slowly have also included functions with this function.
Here is acting as a core function.
It will only run when the mission is completed.
So this this is the core by this function.
So when the only measures completed is function here we run this line of code here which is a lot and
he will display this message board without the call back form included here.
Apparently be an emission may be slow to hide the box and may cause this alert to execute prematurely.
If this function corbucci function is not specified So let's check this out.
So this is my nice red button and this is my DVR which is a blue box.
So if I click on this button here the div will vanish.
That's what I specified here.
Women don't hide from methot and I've told it to hide it slowly and this function is cool but fine John
will hold back this good from running on until that is finished.
So let's do that.
He is gone now that is gone.
The next line of code has now executed with this alert box.
All right.
So next if I remove the core function you see what I saw.
I have now removed the corbat function from this power here.
So all is got to move past it.
Apparently there of 1000 milliseconds that means it will be slow.
In hiding.
Div.
So in that time he doesn't allow this piece of code here executes before the action.
The animation is completed so what taps are let me click on this click on this.
I will expect this alert to execute before the animation completes because the animation is slow to
hide so that 5
me refresh that O K has some slight issues.
He could be left out.
This cut one of these semicolons.
Anyway this is the code I have removed the core function from this.
Parameters have passed.
A tiny parameters of 1000 milliseconds.
So if I execute this code because I've removed the core function this line of code here may will not
wait for the animation to complete.
Don't forget because we've just group a query called this execute line after line.
So but because the animation value I've set it will make it slow to hide.
The alert will not wait and just execute.
So this is what can cause problems in the life code.
So if I run that see this has a code before any mission completed.
He didn't wait for the animation to complete.
So this is why it is important to use a call-back function when inside the animation values in this
video.
I explained what he calls back function.
It's the importance of fake corbat function.
It helps prevent code from executing too early.
This is especially use with Jake Query effects like animation.
So I showed an example whereby I remove the corbat function and record execute executed too early because
it did not wait for the animation to complete whereby I included the core function inside the parameters
of the animations.
Well this is the height and motion and between parentheses includes two parameters one is for the high
to be slow and the other days for a function and the function and here he will not run on till the animation
or the div is completely hit.
So let's test this one one time.
Click on that you see and then run.
This is how it's meant to work.
This the next line of code should only execute after Lisa's completeness is completed a devious hida
but with without the core but function.
This piece of code you execute to see if the parameter past is too slow in hiding the div.
Thank you so much.
I all the information in this video has been helpful.
You now have an idea of why a call but function is used.
Thank you and bye for now.