<div class="demo-content">
<div class="box" id="with-jquery">jQuery</div>
<a href="#" class="play" id="play-jquery"><span class="ion ion-play"></span>Play</a>
<div class="box" id="with-velocity">Velocity.js</div>
<a href="#" class="play" id="play-velocity"><span class="ion ion-play"></span>Play</a>
</div>
body {
background-color: #F5F7FA;
}
.demo-content {
padding: 30px 20px;
}
.box {
padding: 12px 12px;
background-color: #fff;
margin-bottom: 15px;
max-width: 100px;
text-align: center;
font-family: "Roboto", Arial, sans-serif;
border: 1px solid #656D78;
color: #656D78;
position: relative;
box-shadow: 3px 3px 0 0 rgba(0,0,0,0.1);
}
.play {
color: #AAB2BD;
font-family: "Roboto", Arial, sans-serif;
font-size: 12px;
text-transform: uppercase;
text-decoration: none;
display: block;
width: 80px;
margin-bottom: 30px;
border-radius: 30px;
}
.play:hover {
color: #656D78;
}
.ion {
margin-right: 5px;
}
function withAnimate() {
$("#with-jquery").animate({
left: "500px",
}, {
duration: 3000,
easing: "linear"
} );
}
$("#play-jquery").on('click', function(){
withAnimate();
});
function withVelocity() {
$("#with-velocity").velocity({
left: "500px",
}, {
duration: 3000,
easing: "linear"
} );
}
$("#play-velocity").on('click', function(){
withVelocity();
});