mv js to jquery.js, add css animation to achieve same effect