The problem is that the gallery doesn’t exist when colorbox binds itself to the gallery links. I was able to fix this problem by using the ajaxComplete()
event, like so:
$(document).ajaxComplete(function(){
$('.gallery-icon a').colorbox();
});
Thanks @Milo for pointing me in the right direction.
Related Posts:
- Ajax Load More Posts in Category Page
- Call current post URL in ajax
- Ajax post doesnt call succes after got the response
- Dynamically update post title in admin page
- Can I load posts via Ajax?
- How to load post content on index page using ajax when post title in sidebar is clicked
- POST from jQuery to PHP
- “Uncaught SyntaxError: Unexpected token
- Add confirmation popup on “Move to Trash”
- The correct way to call posts with ajax
- How do I use Ajax to show the new posts realtime, on the frontpage
- How to create a load more post entries like Twitter?
- Ajax load more button in Recent posts widget
- Ajax Dynamic Archives not showing correct results
- WP_Query with ajax handler returns the same posts
- Ajax post filters not working
- Ajaxify This Code
- Genesis + Ajax + Jquery | Failling to call action
- WordPress as CMS: How to manage/handle images assigned to a post as full-sized background images in a slideshow?
- Using the loop to set locations for all posts on a single google map
- Many buttons not functioning in WordPress dashboard (as admin)
- WP Load post with ajax and apply isotope
- Dynamic Gallery
- Get post id on click of thumbnail
- Implement AJAX ‘load more’ with offset posts
- Cross-Origin Read Blocking (CORB)
- Cross-Origin Read Blocking (CORB)
- syntax error: unexpected token <
- Infinite Scrolling in Asp.Net MVC with jQuery / AJAX Issues
- My javascript is returning this error: $.ajax is not a function
- ajax jquery simple get request
- jQuery get textarea text
- jQuery AJAX cross domain
- Set timeout for ajax (jQuery)
- How to generate a simple popup using jQuery
- What does on() in JavaScript do?
- jQuery AJAX submit form
- jQuery Ajax File Upload
- How can I upload files asynchronously with jQuery?
- Adding images to a Bootstrap Carousel with AJAX
- AJAX response error: net::ERR_EMPTY_RESPONSE
- Access Control Request Headers, is added to header in AJAX request with jQuery
- jQuery Ajax POST example with PHP
- Refresh/reload the content in Div using jquery/ajax
- SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
- How to manage a redirect request after a jQuery Ajax call
- FormData append not working
- Uncaught TypeError: Cannot read property ‘toLowerCase’ of undefined
- Download a file by jQuery.Ajax
- Ajax success function
- Turn a URL into an Attachment / Post ID
- ZIP up all images displayed in a [gallery] and offer as download link
- Keyboard shortcut for updating a page or post?
- How to make comments work for a post loaded per Ajax?
- Enable Submit Comment Without Page Reload (Using Ajax)?
- Can’t get a JSON object in response to an Ajax request with wp_ajax
- Confirmation box when submitting post for review
- Add existing images from Media Library in to custom gallery
- How to load paginated post pages via ajax
- Infinite scroll / lazy loading with NextGen Gallery [closed]
- Get the current post ID as a variable in Javascript
- Getting the post_id in wp_ajax function
- How to create WP Editor using javascript
- Ajax call does not activate callback function
- WordPress Ajax always returns a 404 error
- Load posts dynamically
- Add javascript when post is published
- Getting an alphabetic post list with two letters onclick on letter
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How to use oEmbeds on Post Content during AJAX requests
- Get post from custom REST endpoint in Gutenberg
- Show Custom Taxonomy Categories, Listing of Posts, and Single Post via AJAX
- Trying to get single posts to load on the front page via ajax
- This AJAX Code Doesn’t Work – Looking for elegant solution
- Drag and drop multiple file upload using Ajax WordPress
- Cannot access current post’s ID in custom plugin
- How do I change the gallery that is inserted in the post?
- Ajax not firing properly using Firefox, but works in Chrome
- Turn jQuery.ajax() request into XMLHttpRequest (vanilla JavaScript)
- Handling an Ajax form submit
- Load post content into div with ajax
- Working Bootstrap Carousel Conversion to WP – Technical Questions
- How to Use JSON With AJAX?
- Using wp_ajax and wp_ajax_nopriv hooks
- Using an Image Slider twice on the same page
- admin-ajax.php HTTP400: BAD REQUEST – The request could not be processed by the server due to invalid syntax
- WordPress theme ajax have_posts()
- WordPress AJAX Call Not Return Result
- How to create popup same as wordpress popup feature
- Create a separate JS application for an individual post?
- Click loads template via ajax
- Display notification only once
- Convert a complex webpage into WP theme
- Access/update database with jQuery
- how load content as pop-up using ajax
- How to display something in a div when the user clicks on a text in another div – no page refresh [closed]
- wp_ajax unauthenticated and authenticated
- Load content in a div with ajax
- WordPress ajax function parameter value not being passed
- How can I remove “”