Restore slide transition and rewrite JS in JS