Home › Forums › Add-ons › Repeater Field › jQuery toggle with ACF repeater › Reply To: jQuery toggle with ACF repeater
This is really outside of ACF. But what you’ll need to do is to pass the “toggle” that was clicked to the function, I’m not sure how to do this because I’m not all that familiar with jQuery. Then you need to get the container element and only target items in that element. from what I can find, something like this, but please note, I cannot promise this will work, I have not tested it and like I said, I’m not all that great with jQuery
$(".toggle-trigger").click(function(){
// I think that this will get the block on the toggle that was clicked
var block = this.closest('.announcement-block');
// I think this will toggle only this element
block.find('.announcement-block-inner').toggle();
// not sure how to change the icon given what you've supplied
// I think what you need to do is get the icon element and change the class
// based on the icon that is already shown
});
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.