Home › Forums › Front-end Issues › Refresh custom gallery image without page reload using jQuery prevent default › Reply To: Refresh custom gallery image without page reload using jQuery prevent default
Hi @ddogdani
I believe the preventDefault() function doesn’t work because the target is not correct. Could you please try this one instead:
$( ".lslide a, .clone a" ).click(function( event ) {
event.preventDefault();
});
The append part should be replaced with JS code that can replace the main image with the right one. If you use AJAX to get the image, then you need to execute the function here. If you use a slider plugin, please ask the plugin author about it.
I hope this helps 🙂
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.