- Notifications
You must be signed in to change notification settings - Fork111
JavaScript Animations#136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Changes fromall commits
daa190066086ae0c253966aeed8b4ae47f0c1f4878e6ffa434d4df64035218dFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,10 @@ | ||
| Para quicar, podemos usar a propriedadeCSS `top`e `position:absolute`para a bola dentro do campo com `position:relative`. | ||
| A coordenada inferior do campo é`field.clientHeight`.Mas a propriedade`top`fornece coordenadas para o topo da bola Então animamos a propriedade `top` a partir de`0`até `field.clientHeight - ball.clientHeight`,isto é até à posição mais baixa do topo da bola. | ||
| Para obter o efeito de "quique", podemos usar a função de tempo`bounce`no modo`easeOut`. | ||
karlasamantha marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| Aqui está o código final para a animação: | ||
karlasamantha marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
karlasamantha marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| ```js | ||
karlasamantha marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| let to = field.clientHeight - ball.clientHeight; | ||
karlasamantha marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
Uh oh!
There was an error while loading.Please reload this page.