Code snippet: JS to update carousel components to auto-rotate