update slide on Javascript