Implementation of carousel using pure javascript without third party components