Update script.js

Added script for sliding with animation.