You are using an ID to target in jQuery. I’m guessing that you have multiple html elements with the same ID (#carousel, #slider). ID attribute values must be unique on a page. I would try to use a classes instead of IDs when using multiples on the same page.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users