Adding .js script to carousel pattern