Answer the question
In order to leave comments, you need to log in
What tools do you use for animation?
In simple cases, everyone tries to use css animation, but if it just doesn't work, then what do you use besides jQuery and in what cases? For example, to animate values to auto, which cannot be done in css.
Answer the question
In order to leave comments, you need to log in
Javascript:
<div class="result pointer" onclick="jump(this);" style="background:#eee; display: inline-block; padding: 5px;">
Прыгучий объект
</div>
<script type="text/javascript">
function jump (el) {
el.style.position='relative';
var i=0, an= setInterval(function() {
if (i>=Math.PI) {
clearInterval(an);
el.style.top= 0;
} else el.style.top= -100*Math.sin(i) + 'px';
i+=.1;
},25)
}
</script>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question