Added js logic to carousel.