move js code init slide at the right place