Velocity.js - 2
Velocity.js jQuery animasyon akışını geliştirmek için yeni özellikler eklenmiş ve belirgin ölçülerde yüksek performans almamızı sağlayan bir animasyon iyileştirici plugindir.
HTML
<script src="http://julian.com/research/velocity/build/jquery.velocity.min.js"></script>
<div class="box" id="jQuery"><span>jQuery</span></div>
<div class="box" id="velocity"><span>velocity</span></div>
<svg width="350" height="80">
<rect x="30" y="5" width="300" height="50" rx="15" ry="15"/>
<line id="line" x1="30" y1="5" x2="30" y2="55" style="stroke:rgb(255,0,0);stroke-width:2"/>
</svg>
CSS
html,body{width:100%;height:100%;}
body{overflow:hidden;margin-left:25%;}
.box{position:relative;display:inline-block;width:25%;height:25%;border:1px solid #000;background-color:#f0f0f0;}
.box span{position:relative;display:block;text-align:center;top:50%;margin-top:-10px;line-height:20px;font:16px Verdana;font-weight:bold;}
JavaScript
$jQuery=$("#jQuery");
$velocity=$("#velocity");
$line=$("#line")''
$jQuery
.animate({top:"60%"},{duration:1000})
.animate({top:"0"},{duration:2000});
$velocity
.velocity({top:"60%"},{duration:1000})
.velocity("reverse",2000);
$line